cloud

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL