bq

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CreateDataset(dataset string) error
	DeleteDataset(dataset string) error
	CreateTable(dataset string, tableID string, metadata *bigquery.TableMetadata) error
	DeleteTable(dataset string, tableID string) error
	DatasetIterator(callback func(dataset *bigquery.Dataset)) error
	Insert(dataset string, tableID 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(gcpProjectID 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(datasetID string, tableID 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 Telemetry

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

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