mbigtable

package
v0.0.0-...-c20f884 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mbigtable implements connecting to Google's Bigtable service and simplifying a number of interactions with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bigtable

type Bigtable struct {
	*bigtable.Client
	Instance string
	// contains filtered or unexported fields
}

Bigtable is a wrapper around a bigtable client providing more functionality.

func WithBigTable

func WithBigTable(parent context.Context, gce *mdb.GCE, defaultInstance string) (context.Context, *Bigtable)

WithBigTable returns a Bigtable instance which will be initialized and configured when the start event is triggered on the returned Context (see mrun.Start). The Bigtable instance will have Close called on it when the stop event is triggered on the returned Context (see mrun.Stop).

gce is optional and can be passed in if there's an existing gce object which should be used, otherwise a new one will be created with mdb.MGCE.

defaultInstance can be given as the instance name to use as the default parameter value. If empty the parameter will be required to be set.

func (*Bigtable) EnsureTable

func (bt *Bigtable) EnsureTable(ctx context.Context, name string, colFams ...string) error

EnsureTable ensures that the given table exists and has (at least) the given column families.

This method requires admin privileges on the bigtable instance.

func (*Bigtable) Table

func (bt *Bigtable) Table(tableName string) *bigtable.Table

Table returns the bigtable.Table instance which can be used to write/query the given table.

Jump to

Keyboard shortcuts

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