usage

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQuery

type BigQuery interface {
	QueryUsageSummary(ctx context.Context, userID string, creatorID string, spec QuerySpec) (*UsageSummaryRow, error)
	QueryUsageSummaryWithTimestep(ctx context.Context, userID string, creatorID string, spec QuerySpec) (*[]UsageSummaryRow, error)
}

func NewBigQuery

func NewBigQuery(opts BigQueryOptions) (BigQuery, error)

type BigQueryOptions

type BigQueryOptions struct {
	BigQueryCredentialsJSON   string
	HourlyUsageTable          string
	MaxBytesBilledPerBigQuery int64
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ClientOptions) (*Client, error)

func (*Client) QuerySummary

func (c *Client) QuerySummary(ctx context.Context, userID string, creatorID string, spec QuerySpec) (*UsageSummaryRow, error)

func (*Client) QuerySummaryWithTimestep

func (c *Client) QuerySummaryWithTimestep(ctx context.Context, userID string, creatorID string, spec QuerySpec) (*[]UsageSummaryRow, error)

type ClientOptions

type ClientOptions struct {
	Livepeer livepeer.ClientOptions
	BigQueryOptions
}

type QueryFilter

type QueryFilter struct {
	CreatorID string
	UserID    string
}

type QuerySpec

type QuerySpec struct {
	TimeStep string
	From, To *time.Time
	Filter   QueryFilter
}

type UsageSummaryRow

type UsageSummaryRow struct {
	UserID    string `bigquery:"user_id"`
	CreatorID string `bigquery:"creator_id"`

	DeliveryUsageMins float64 `bigquery:"delivery_usage_mins"`
	TotalUsageMins    float64 `bigquery:"transcode_total_usage_mins"`
	StorageUsageMins  float64 `bigquery:"storage_usage_mins"`
}

Jump to

Keyboard shortcuts

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