bigtable

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// We use a single BigTable table for storing Task Driver runs.
	BT_TABLE = "task-driver-runs"

	// We use a single BigTable column family.
	BT_COLUMN_FAMILY = "MSGS"

	// We use a single BigTable column which stores gob-encoded td.Messages.
	BT_COLUMN = "MSG"

	// Format used for BigTable row keys.
	ROW_KEY_FORMAT = "%s#%010d"

	INSERT_TIMEOUT = 30 * time.Second
	QUERY_TIMEOUT  = 5 * time.Second
)

Variables

View Source
var (
	// Fully-qualified BigTable column name.
	BT_COLUMN_FULL = fmt.Sprintf("%s:%s", BT_COLUMN_FAMILY, BT_COLUMN)
)

Functions

This section is empty.

Types

type BTDB

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

BTDB is an implementation of db.DB which uses BigTable.

func NewBigTableDB

func NewBigTableDB(ctx context.Context, project, instance string, ts oauth2.TokenSource) (*BTDB, error)

NewBigTableDB returns a db.DB instance which uses BigTable.

func (*BTDB) Close

func (d *BTDB) Close() error

See documentation for db.DB interface.

func (*BTDB) GetMessagesForTaskDriver

func (d *BTDB) GetMessagesForTaskDriver(id string) ([]*td.Message, error)

GetMessagesForTaskDriver returns all td.Messages sent for the Task Driver with the given ID.

func (*BTDB) GetTaskDriver

func (d *BTDB) GetTaskDriver(id string) (*db.TaskDriverRun, error)

See documentation for db.DB interface.

func (*BTDB) UpdateTaskDriver

func (d *BTDB) UpdateTaskDriver(id string, msg *td.Message) error

See documentation for db.DB interface.

Jump to

Keyboard shortcuts

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