bqclient

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("no rows returned")
)

Functions

This section is empty.

Types

type BQClient

type BQClient interface {
	Put(ctx context.Context, table string, data any) error
	StreamRead(ctx context.Context, table string, projectIDs []string) (<-chan []byte, <-chan error)
	StreamPut(ctx context.Context, table string, data any) error
	StreamPutAll(ctx context.Context, inputs map[string][]any) error
	Query(ctx context.Context, query string, params []bigquery.QueryParameter) (*bigquery.RowIterator, error)
	QueryRow(ctx context.Context, query string, params []bigquery.QueryParameter, dst any) error
	Update(ctx context.Context, table string, id string, updates map[string]interface{}) error
	Delete(ctx context.Context, table string, id string) error
	Get(ctx context.Context, table string, id string, dst any) error
	Close() error
}

func New

func New(ctx context.Context, cfg *Config) (BQClient, error)

type Config

type Config struct {
	ProjectID string `koanf:"project_id" json:"project_id" envconfig:"project_id"`
	DatasetID string `koanf:"dataset_id" json:"dataset_id" envconfig:"dataset_id"`
	CredsPath string `koanf:"creds_path" json:"creds_path" envconfig:"creds_path"`
}

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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