gcp

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEOF = event.ErrEOF

Functions

func Query

func Query(account string, tr usagetime.Range) (*storage.Query, error)

Query() returns a query for usage data for an Upbound account across a range of time. The start of the range is inclusive and the end is exclusive to the hour.

Types

type ObjectHandleEventReader

type ObjectHandleEventReader struct {
	Object *storage.ObjectHandle
	Attrs  *storage.ObjectAttrs
	// contains filtered or unexported fields
}

func (*ObjectHandleEventReader) Close

func (r *ObjectHandleEventReader) Close() error

func (*ObjectHandleEventReader) Read

type ObjectIteratorEventReader

type ObjectIteratorEventReader struct {
	Bucket   *storage.BucketHandle
	Iterator *storage.ObjectIterator
	// contains filtered or unexported fields
}

func (*ObjectIteratorEventReader) Close

func (r *ObjectIteratorEventReader) Close() error

func (*ObjectIteratorEventReader) Read

type QueryEventReader

type QueryEventReader struct {
	Bucket *storage.BucketHandle
	Query  *storage.Query
	// contains filtered or unexported fields
}

func (*QueryEventReader) Close

func (r *QueryEventReader) Close() error

func (*QueryEventReader) Read

type QueryIterator

type QueryIterator struct {
	Account string
	Iter    *usagetime.WindowIterator
}

QueryIterator iterates through queries for usage data for an Upbound account across a range of time. Each query covers a window of time within the time range. Must be initialized with NewUsageQueryIterator().

func NewQueryIterator

func NewQueryIterator(account string, tr usagetime.Range, window time.Duration) (*QueryIterator, error)

NewQueryIterator() returns an initialized *UsageQueryIterator. The start of the time range is inclusive and the end is exclusive to the hour. The time range and window are truncated to the hour.

func (*QueryIterator) More

func (i *QueryIterator) More() bool

More() returns true if Next() has more queries to return.

func (*QueryIterator) Next

Next() returns a query covering the next window of time, as well as a pair of times marking the start and end of the window.

type WindowIterator

type WindowIterator struct {
	Iter   *QueryIterator
	Bucket *storage.BucketHandle
}

WindowIterator iterates through readers for windows of usage events from an Azure blob storage container. Must be initialized with NewWindowIterator().

func NewWindowIterator

func NewWindowIterator(bkt *storage.BucketHandle, account string, tr usagetime.Range, window time.Duration) (*WindowIterator, error)

NewWindowIterator returns an initialized *WindowIterator.

func (*WindowIterator) More

func (i *WindowIterator) More() bool

func (*WindowIterator) Next

Jump to

Keyboard shortcuts

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