PolicyFor returns the metering policy for an account class. Only standard accounts are metered/billed/analyzed; every non-standard class (internal, system, demo) is excluded on all three axes. An unknown/empty value fail-closed defaults to standard so a misclassified account is never silently exempt
(c AccountClass)
| 32 | // fail-closed defaults to standard so a misclassified account is never silently |
| 33 | // exempted from billing. |
| 34 | func PolicyFor(c AccountClass) MeteringPolicy { |
| 35 | switch c { |
| 36 | case ClassInternal, ClassSystem, ClassDemo: |
| 37 | return MeteringPolicy{Meter: false, Bill: false, Analytics: false} |
| 38 | default: // ClassStandard and any unrecognized value |
| 39 | return MeteringPolicy{Meter: true, Bill: true, Analytics: true} |
| 40 | } |
| 41 | } |
no outgoing calls