Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DroppedEventCounter = MetricSet.NewCounter("metering_payment_gateway_dropped_event_counter", "Counter of drop metering events from the metering paymentGateway:// service")
var MeteringGRPCErrCounter = MetricSet.NewCounter("metering_payment_gateway_err_counter", "Counter of gRPC errors received from the Payment Gateway service")
var MetricSet = dmetrics.NewSet()
Functions ¶
func Register ¶
func Register()
Register registers the payment gateway emitter inside dmetering package by calling dmetering.Register with the proper factory function. The emitter accepts a URL with the following format:
paymentGateway://<endpoint>?network=<network>&token=${SF_API_TOKEN}[&insecure=true|false][&plaintext=true|false][&delay=1s][&buffer_size=1000][&panic_on_drop=true|false]
The metering plugin will emit events to the payment gateway service pointed to by <endpoint> (required). The endpoint can contains a `:<port>` suffix to specify which port to use. If the port is not provided, 443 is assumed.
The connection is secured by TLS by default. If the `insecure` query parameter is set to `true`, the connection will be made with TLS but without verifying the certificate. The `plaintext` is reserved for development purposes and the connection is made without TLS, you cannot use that on production endpoints since they require a <token> and that a <token> can be sent onlt if the connection is secured with TLS.