dataset

package
v0.0.0-...-2faa25e Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountCostSchema = bigquery.Schema{
	{Name: "account_id", Type: bigquery.StringFieldType},
	{Name: "description", Type: bigquery.StringFieldType},
	{Name: "date", Type: bigquery.DateFieldType},
	{Name: "service", Type: bigquery.StringFieldType},
	{Name: "record_type", Type: bigquery.StringFieldType},
	{Name: "unblended_cost", Type: bigquery.FloatFieldType},
	{Name: "blended_cost", Type: bigquery.FloatFieldType},
	{Name: "amortized_cost", Type: bigquery.FloatFieldType},
	{Name: "net_amortized_cost", Type: bigquery.FloatFieldType},
	{Name: "net_unblended_cost", Type: bigquery.FloatFieldType},
	{Name: "inserted_at", Type: bigquery.TimestampFieldType},
}
View Source
var ReservationSchema = bigquery.Schema{
	{Name: "account_id", Type: bigquery.StringFieldType},
	{Name: "description", Type: bigquery.StringFieldType},
	{Name: "region", Type: bigquery.StringFieldType},
	{Name: "instance_type", Type: bigquery.StringFieldType},
	{Name: "platform", Type: bigquery.StringFieldType},
	{Name: "cache_engine", Type: bigquery.StringFieldType},
	{Name: "database_engine", Type: bigquery.StringFieldType},
	{Name: "deployment_option", Type: bigquery.StringFieldType},
	{Name: "date", Type: bigquery.DateFieldType},
	{Name: "hours", Type: bigquery.FloatFieldType},
	{Name: "num", Type: bigquery.FloatFieldType},
	{Name: "percentage", Type: bigquery.FloatFieldType},
	{Name: "inserted_at", Type: bigquery.TimestampFieldType},
}

Functions

func AccountCostMeta

func AccountCostMeta(period string) bigquery.TableMetadata

func Create

func Create(ctx context.Context, projectID, location, dsn string, meta []bigquery.TableMetadata) error

func Delete

func Delete(ctx context.Context, projectID, location, dsn string, meta []bigquery.TableMetadata) error

func Insert

func Insert(ctx context.Context, projectID, location, dsn, table string, items []interface{}) error

func Query

func Query(ctx context.Context, projectID, location, query string, fn func(values []bigquery.Value)) error

func ReservationMeta

func ReservationMeta(period string) bigquery.TableMetadata

func Tables

func Tables(ctx context.Context, projectID, location, dsn string) ([]bigquery.TableMetadata, error)

Types

type AccountCost

type AccountCost struct {
	AccountID        string     `bigquery:"account_id"`
	Description      string     `bigquery:"description"`
	Date             civil.Date `bigquery:"date"`
	Service          string     `bigquery:"service"`
	RecordType       string     `bigquery:"record_type"`
	UnblendedCost    float64    `bigquery:"unblended_cost"`     // volume discount for a single account
	BlendedCost      float64    `bigquery:"blended_cost"`       // volume discount across linked account
	AmortizedCost    float64    `bigquery:"amortized_cost"`     // unblended + ReservedInstances/12
	NetAmortizedCost float64    `bigquery:"net_amortized_cost"` // before discount
	NetUnblendedCost float64    `bigquery:"net_unblended_cost"` // before discount
	InsertedAt       time.Time  `bigquery:"inserted_at"`
}

type Client

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

func New

func New(ctx context.Context, projectID, location string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Create

func (c *Client) Create(ctx context.Context, dsn string, meta []bigquery.TableMetadata) error

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, dsn string, meta []bigquery.TableMetadata) error

func (*Client) Insert

func (c *Client) Insert(ctx context.Context, dsn, table string, items []interface{}) error

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string, fn func(values []bigquery.Value)) error

func (*Client) Tables

func (c *Client) Tables(ctx context.Context, dsn string) ([]bigquery.TableMetadata, error)

type Reservation

type Reservation struct {
	AccountID        string     `bigquery:"account_id"`
	Description      string     `bigquery:"description"`
	Region           string     `bigquery:"region"`
	InstanceType     string     `bigquery:"instance_type"`
	Platform         string     `bigquery:"platform"`
	CacheEngine      string     `bigquery:"cache_engine"`
	DatabaseEngine   string     `bigquery:"database_engine"`
	DeploymentOption string     `bigquery:"deployment_option"`
	Date             civil.Date `bigquery:"date"`
	Hours            float64    `bigquery:"hours"`
	Num              float64    `bigquery:"num"`
	Percentage       float64    `bigquery:"percentage"`
	InsertedAt       time.Time  `bigquery:"inserted_at"`
}

Jump to

Keyboard shortcuts

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