Documentation
¶
Overview ¶
Package metering provides client and tools to interact with the adapter server
Package metering provides models to interact with the adapter server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// CreateUsageEvent creates a single usage event at the cloud provider metering service.
CreateUsageEvent(ctx context.Context, req UsageEvent) (UsageEventResponse, error)
// CreateUsageEventBatch creates a event batch at the cloud provider metering service.
CreateUsageEventBatch(ctx context.Context, req UsageEventBatch) (UsageEventBatchResponse, error)
}
Client represents the metering operations and it's responsible to handle each specific cloud provider business rules, data conversions and validations.
func NewMeteringClient ¶
func NewMeteringClient(options *ClientOptions) Client
type ClientOptions ¶
type ClientOptions struct {
BaseURL string
}
type UsageEvent ¶
type UsageEvent struct {
DimensionID string `json:"dimensionId"`
Quantity float32 `json:"quantity"`
StartAt time.Time `json:"startAt"`
}
UsageEvent represents an usage event for metering purpose
type UsageEventBatch ¶
type UsageEventBatch struct {
Events []UsageEvent `json:"events"`
}
UsageEventBatch a type to represent the usage metering batch events request
type UsageEventBatchResponse ¶
type UsageEventBatchResponse struct {
Result []UsageEventResponse `json:"result"`
}
UsageEventBatchResponse a type to represent the usage metering event batch response
type UsageEventResponse ¶
type UsageEventResponse struct {
UsageEventID string `json:"usageEventId"`
DimensionID string `json:"dimensionId"`
Status string `json:"status"`
}
UsageEventResponse represents an usage event response
Click to show internal directories.
Click to hide internal directories.