Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPStorage ¶
type HTTPStorage struct {
// contains filtered or unexported fields
}
HTTPStorage represents a usage storage which posts meters over HTTP.
func (*HTTPStorage) Configure ¶
func (s *HTTPStorage) Configure(config map[string]interface{}) (err error)
Configure configures the provider.
func (*HTTPStorage) Get ¶
func (s *HTTPStorage) Get(id uint32) Meter
Get retrieves a meter for a contract.
func (*HTTPStorage) Name ¶
func (s *HTTPStorage) Name() string
Name returns the name of the provider.
type Meter ¶
type Meter interface { GetContract() uint32 // Returns the associated contract. AddIngress(size int64) // Records the ingress message size. AddEgress(size int64) // Records the egress message size. AddDevice(addr string) // Records the device address. }
Meter represents a tracker for incoming and outgoing traffic.
type Metering ¶
type Metering interface { config.Provider // Get retrieves a meter for a contract. Get(id uint32) Meter }
Metering represents a contract for a usage metering
type NoopStorage ¶
type NoopStorage struct{}
NoopStorage represents a usage storage which does nothing.
func (*NoopStorage) Configure ¶
func (s *NoopStorage) Configure(config map[string]interface{}) error
Configure configures the provider
func (*NoopStorage) Get ¶
func (s *NoopStorage) Get(id uint32) Meter
Get retrieves a meter for a contract.
func (*NoopStorage) Name ¶
func (s *NoopStorage) Name() string
Name returns the name of the provider.
Click to show internal directories.
Click to hide internal directories.