bigquery

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func NewConfig

func NewConfig(projectId string, jwtbys []byte, schemas []*TableSchema, queueSize, workerSize, workerStack int, workerDelay time.Duration) (*Config, error)

type ErrorHandler

type ErrorHandler func(error)

type Job

type Job struct {
	Msg *Message
}

message

type Message

type Message struct {
	DatasetId string
	TableId   string
	Data      Row
}

type Row

type Row interface {
	Save() (row map[string]bigquery.Value, insertID string, err error)
	Schema() (schema *TableSchema, err error)
	PublishedAt() time.Time
	InsertId() string
}

type Streamer

type Streamer interface {
	AddRow(ctx context.Context, row Row) error
	AddRowSync(ctx context.Context, row Row) error
}

func NewStreamer

func NewStreamer(cfg *Config, errFunc ErrorHandler) (Streamer, error)

type TablePeriod

type TablePeriod int
const (
	NotExist TablePeriod = iota
	Daily
	Monthly
	Yearly
)

type TableSchema

type TableSchema struct {
	DatasetId string                  // bigquery datasetId
	Prefix    string                  // bigquery table prefix
	Meta      *bigquery.TableMetadata // bigquery table meta
	Period    TablePeriod             // TablePeriod
}

type Worker

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

worker

type WorkerDispatcher

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

dispatcher

Jump to

Keyboard shortcuts

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