bq

package
v0.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DatasetDev     = "dev"
	TableTelemetry = "telemetry"
)

Variables

This section is empty.

Functions

func GetTelemetryTableMetadata added in v0.2.4

func GetTelemetryTableMetadata() *bigquery.TableMetadata

Types

type Client

type Client interface {
	CreateDataset(dataset string) error
	DeleteDataset(dataset string) error
	CreateTable(dataset string, table string, metadata *bigquery.TableMetadata) error
	DeleteTable(dataset string, table string) error
	DatasetIterator(callback func(dataset *bigquery.Dataset)) error
	Insert(dataset string, table string, src interface{}) error
	Query(q string) error
	QueryIterator(q string, params []bigquery.QueryParameter) (Iterator, error)
	GetQueryStats(q string, params []bigquery.QueryParameter) (*bigquery.JobStatistics, error)
	Close() error
}

func NewClient

func NewClient(project string) Client

func NewClientAuth added in v0.2.5

func NewClientAuth(project string) Client

func NewClientInMemory

func NewClientInMemory() Client

type ClientImpl

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

func (*ClientImpl) Close

func (client *ClientImpl) Close() error

func (*ClientImpl) CreateDataset

func (client *ClientImpl) CreateDataset(dataset string) error

func (*ClientImpl) CreateTable

func (client *ClientImpl) CreateTable(dataset string, table string, metadata *bigquery.TableMetadata) error

func (*ClientImpl) DatasetIterator

func (client *ClientImpl) DatasetIterator(callback func(dataset *bigquery.Dataset)) error

func (*ClientImpl) DeleteDataset

func (client *ClientImpl) DeleteDataset(dataset string) error

func (*ClientImpl) DeleteTable

func (client *ClientImpl) DeleteTable(dataset string, table string) error

func (*ClientImpl) GetQueryStats

func (client *ClientImpl) GetQueryStats(q string, params []bigquery.QueryParameter) (*bigquery.JobStatistics, error)

func (*ClientImpl) Insert

func (client *ClientImpl) Insert(dataset string, table string, src interface{}) error

func (*ClientImpl) Query

func (client *ClientImpl) Query(q string) error

func (*ClientImpl) QueryIterator

func (client *ClientImpl) QueryIterator(q string, params []bigquery.QueryParameter) (Iterator, error)

type ClientInMemory

type ClientInMemory struct{}

func (*ClientInMemory) Close

func (*ClientInMemory) Close() error

func (*ClientInMemory) CreateDataset

func (*ClientInMemory) CreateDataset(string) error

func (*ClientInMemory) CreateTable

func (*ClientInMemory) DatasetIterator

func (*ClientInMemory) DatasetIterator(func(*bigquery.Dataset)) error

func (*ClientInMemory) DeleteDataset

func (*ClientInMemory) DeleteDataset(string) error

func (*ClientInMemory) DeleteTable

func (*ClientInMemory) DeleteTable(string, string) error

func (*ClientInMemory) GetQueryStats

func (c *ClientInMemory) GetQueryStats(q string, params []bigquery.QueryParameter) (*bigquery.JobStatistics, error)

func (*ClientInMemory) Insert

func (c *ClientInMemory) Insert(string, string, interface{}) error

func (*ClientInMemory) Query

func (*ClientInMemory) Query(string) error

func (*ClientInMemory) QueryIterator

type Iterator

type Iterator interface {
	TotalRows() uint64
	Next(dst interface{}) error
}

type IteratorWrapper

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

func (*IteratorWrapper) Next

func (i *IteratorWrapper) Next(dst interface{}) error

func (*IteratorWrapper) TotalRows

func (i *IteratorWrapper) TotalRows() uint64

type KeyValue added in v0.2.4

type KeyValue struct {
	Key   string `bigquery:"key"`
	Value string `bigquery:"value"`
}

type Telemetry

type Telemetry struct {
	Application        string         `bigquery:"application"`
	ApplicationVersion string         `bigquery:"application_version"`
	Time               civil.DateTime `bigquery:"time"`
	MachineId          string         `bigquery:"machine_id"`
	Runtime            string         `bigquery:"runtime"`
	Platform           string         `bigquery:"platform"`
	Command            string         `bigquery:"command"`
	Args               []string       `bigquery:"args"`
	Flags              []KeyValue     `bigquery:"flags"`
}

func NewTelemetry added in v0.2.6

func NewTelemetry(app string, appVersion string, t time.Time, machineId string,
	runtime string, platform string, command string, args []string, flags map[string]string) *Telemetry

func (*Telemetry) Save

func (t *Telemetry) Save() (map[string]bigquery.Value, string, error)

Save implements the ValueSaver interface

Jump to

Keyboard shortcuts

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