marketplace

package
v0.13.0-0d335c8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 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 UsageEvent) (UsageEventResponse, error)
	// CreateUsageEventBatch creates a event batch  at the cloud provider metering service.
	CreateUsageEventBatch(ctx context.Context, req UsageEventBatch) (UsageEventBatchResponse, error)
}

MeteringService represents the metering operations and it's responsible to handle each specific cloud provider business rules, data conversions and validations.

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

Jump to

Keyboard shortcuts

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