billing

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enrich added in v0.12.0

func Enrich[E Event](now time.Time, hostname string, countInBatch, batchSize int, event E) E

Enrich sets the event's Type and IdempotencyKey fields, so that users of this API don't need to manually set them

func GetHostname added in v0.28.0

func GetHostname() string

GetHostname returns the hostname to be used for enriching billing events (see Enrich())

This function MUST NOT be run before init has finished.

Types

type AbsoluteEvent

type AbsoluteEvent struct {
	IdempotencyKey string    `json:"idempotency_key"`
	MetricName     string    `json:"metric"`
	Type           string    `json:"type"`
	TenantID       string    `json:"tenant_id"`
	TimelineID     string    `json:"timeline_id"`
	Time           time.Time `json:"time"`
	Value          int       `json:"value"`
}

type Event added in v0.12.0

type Event interface {
	*AbsoluteEvent | *IncrementalEvent
	// contains filtered or unexported methods
}

type IncrementalEvent

type IncrementalEvent struct {
	IdempotencyKey string    `json:"idempotency_key"`
	MetricName     string    `json:"metric"`
	Type           string    `json:"type"`
	EndpointID     string    `json:"endpoint_id"`
	StartTime      time.Time `json:"start_time"`
	StopTime       time.Time `json:"stop_time"`
	Value          int       `json:"value"`
}

Jump to

Keyboard shortcuts

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