Documentation ¶
Index ¶
- Variables
- func BoolColumnItem(row bigtable.Row, familyColumn string) (bool, error)
- func ColumnItem(row bigtable.Row, familyColumn string) (item *bigtable.ReadItem, present bool)
- func IsEmptyRow(row bigtable.Row) bool
- func IsErrColumnNotPresent(err error) bool
- func IsErrEmptyValue(err error) bool
- func JSONColumnItem(row bigtable.Row, familyColumn string, v interface{}) error
- func ProtoColumnItem(row bigtable.Row, familyColumn string, protoResolver func() proto.Message) error
- func StringColumnItem(row bigtable.Row, familyColumn string) (string, error)
- func StringListColumnItem(row bigtable.Row, familyColumn string, separator string) ([]string, error)
- func Uint64ColumnItem(row bigtable.Row, familyColumn string) (uint64, error)
- type BaseTable
- type Bigtable
- func (b *Bigtable) Close() error
- func (b *Bigtable) CreateTables(ctx context.Context, project, instance string, opts ...option.ClientOption)
- func (b *Bigtable) Flush(ctx context.Context) error
- func (b *Bigtable) FlushAllMutations(ctx context.Context) error
- func (b *Bigtable) IncrementPutBlockCounter()
- func (b *Bigtable) ShouldFlushMutations() bool
- func (b *Bigtable) StartSpan(ctx context.Context, protocol string, name string, ...) (context.Context, *trace.Span)
- type ColumnReader
- type ColumnReaderFunc
- type ConnectionInfo
- type DSN
- type ErrColumnNotPresent
- type ErrEmptyValue
- type SetEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var BigIntColumnReader = ColumnReaderFunc(func(row bigtable.Row, familyColumn string) (interface{}, error) { bytes, err := BytesColumnReader(row, familyColumn) if err != nil { return nil, err } return new(big.Int).SetBytes(bytes.([]byte)), nil })
View Source
var BytesColumnReader = ColumnReaderFunc(func(row bigtable.Row, familyColumn string) (interface{}, error) { item, present := ColumnItem(row, familyColumn) if !present { return false, NewErrColumnNotPresent(familyColumn) } return item.Value, nil })
View Source
var Uint64ColumnReader = ColumnReaderFunc(func(row bigtable.Row, familyColumn string) (interface{}, error) { return Uint64ColumnItem(row, familyColumn) })
Functions ¶
func ColumnItem ¶
func IsEmptyRow ¶
func IsErrColumnNotPresent ¶
func IsErrEmptyValue ¶
func JSONColumnItem ¶
func ProtoColumnItem ¶
func ProtoColumnItem(row bigtable.Row, familyColumn string, protoResolver func() proto.Message) error
ProtoColumnItem turns the familyColumn on row into a proper unmarshalled Proto structure. The `protoResolver` exists so that it's possible to implement lazy loading of the actual proto structure to implement. Instead of directly passing the proto, you pass a resolver function that returns the proto to unserialized. Since the resolver is called only when the actual row data exists, we save useless deallocation at the expense of an extra function call.
func StringColumnItem ¶
func StringListColumnItem ¶
Types ¶
type BaseTable ¶
type BaseTable struct { // We "inherit" from `Table` so that `ReadRows` and `ReadRow` is available directly on the instance. *bigtable.Table Name string Families []string // contains filtered or unexported fields }
func NewBaseTable ¶
func (*BaseTable) EnsureTableAndFamiliesExist ¶
func (b *BaseTable) EnsureTableAndFamiliesExist(admin *bigtable.AdminClient)
func (*BaseTable) PendingSets ¶
type Bigtable ¶
type Bigtable struct {
// contains filtered or unexported fields
}
func NewWithClient ¶
func (*Bigtable) CreateTables ¶
func (*Bigtable) FlushAllMutations ¶
func (*Bigtable) IncrementPutBlockCounter ¶
func (b *Bigtable) IncrementPutBlockCounter()
func (*Bigtable) ShouldFlushMutations ¶
type ColumnReader ¶
type ColumnReaderFunc ¶
type ConnectionInfo ¶
DEPRECATED, use DSN instead
func NewConnectionInfo
deprecated
func NewConnectionInfo(connection string) (info *ConnectionInfo, err error)
Deprecated: Use DSN instead. Explode connection string `connection` into its three parts.
type DSN ¶
type ErrColumnNotPresent ¶
type ErrColumnNotPresent struct {
// contains filtered or unexported fields
}
func NewErrColumnNotPresent ¶
func NewErrColumnNotPresent(familyColumn string) *ErrColumnNotPresent
func (*ErrColumnNotPresent) Error ¶
func (e *ErrColumnNotPresent) Error() string
type ErrEmptyValue ¶
type ErrEmptyValue struct {
// contains filtered or unexported fields
}
func NewErrEmptyValue ¶
func NewErrEmptyValue(familyColumn string) *ErrEmptyValue
func (*ErrEmptyValue) Error ¶
func (e *ErrEmptyValue) Error() string
Click to show internal directories.
Click to hide internal directories.