Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeteringService ¶
type MeteringService interface { // CreateUsageEvent creates a single usage event at the cloud provider metering service. CreateUsageEvent(ctx context.Context, req UsageEventReq) (UsageEventRes, error) // CreateUsageEventBatch creates a event batch at the cloud provider metering service. CreateUsageEventBatch(ctx context.Context, req UsageEventBatchReq) (UsageEventBatchRes, error) }
MeteringService represents the metering operations and it's responsible to handle each specific cloud provider business rules, data conversions and validations.
type UsageEventBatchReq ¶
type UsageEventBatchReq struct {
Request []UsageEventReq `json:"request"`
}
UsageEventBatchReq a type to represent the usage metering batch events request
type UsageEventBatchRes ¶
type UsageEventBatchRes struct {
Result []UsageEventRes `json:"result"`
}
UsageEventBatchRes a type to represent the usage metering event batch response
type UsageEventReq ¶
type UsageEventReq struct { DimensionID string `json:"dimensionId"` Quantity float32 `json:"quantity"` StartAt time.Time `json:"startAt"` }
UsageEventReq represents an usage event for metering purpose
type UsageEventRes ¶
type UsageEventRes struct { UsageEventID string `json:"usageEventId"` DimensionID string `json:"dimensionId"` Status string `json:"status"` }
UsageEventRes represents an usage event response
Click to show internal directories.
Click to hide internal directories.