spanner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOption

type ApplyOption = spanner.ApplyOption

type BatchReadOnlyTransactionID

type BatchReadOnlyTransactionID = spanner.BatchReadOnlyTransactionID

type BatchReadOnlyTransactionMock

type BatchReadOnlyTransactionMock struct {
	mock.Mock
}

func (*BatchReadOnlyTransactionMock) AnalyzeQuery

func (mock *BatchReadOnlyTransactionMock) AnalyzeQuery(ctx context.Context, statement Statement) (*QueryPlan, error)

func (*BatchReadOnlyTransactionMock) Cleanup

func (mock *BatchReadOnlyTransactionMock) Cleanup(ctx context.Context)

func (*BatchReadOnlyTransactionMock) Close

func (mock *BatchReadOnlyTransactionMock) Close()

func (*BatchReadOnlyTransactionMock) Execute

func (*BatchReadOnlyTransactionMock) GetID

func (*BatchReadOnlyTransactionMock) PartitionQuery

func (mock *BatchReadOnlyTransactionMock) PartitionQuery(
	ctx context.Context, statement Statement, opts PartitionOptions,
) ([]*Partition, error)

func (*BatchReadOnlyTransactionMock) PartitionRead

func (mock *BatchReadOnlyTransactionMock) PartitionRead(
	ctx context.Context, table string, keys KeySet, columns []string, opts PartitionOptions,
) ([]*spanner.Partition, error)

func (*BatchReadOnlyTransactionMock) PartitionReadUsingIndex

func (mock *BatchReadOnlyTransactionMock) PartitionReadUsingIndex(
	ctx context.Context, table, index string, keys KeySet, columns []string, opts PartitionOptions,
) ([]*spanner.Partition, error)

func (*BatchReadOnlyTransactionMock) Query

func (*BatchReadOnlyTransactionMock) QueryWithStats

func (mock *BatchReadOnlyTransactionMock) QueryWithStats(ctx context.Context, statement Statement) RowIterator

func (*BatchReadOnlyTransactionMock) Read

func (mock *BatchReadOnlyTransactionMock) Read(
	ctx context.Context, table string, keys KeySet, columns []string,
) RowIterator

func (*BatchReadOnlyTransactionMock) ReadRow

func (mock *BatchReadOnlyTransactionMock) ReadRow(
	ctx context.Context, table string, key Key, columns []string,
) (Row, error)

func (*BatchReadOnlyTransactionMock) ReadUsingIndex

func (mock *BatchReadOnlyTransactionMock) ReadUsingIndex(
	ctx context.Context, table, index string, keys KeySet, columns []string,
) RowIterator

func (*BatchReadOnlyTransactionMock) ReadWithOptions

func (mock *BatchReadOnlyTransactionMock) ReadWithOptions(
	ctx context.Context, table string, keys KeySet, columns []string, opts *ReadOptions) RowIterator

type Client

type Client interface {
	Apply(context.Context, []*Mutation, ...ApplyOption) (time.Time, error)
	BatchReadOnlyTransaction(context.Context, TimestampBound) (BatchReadOnlyTransaction, error)
	BatchReadOnlyTransactionFromID(BatchReadOnlyTransactionID) BatchReadOnlyTransaction
	Close()
	PartitionedUpdate(context.Context, Statement) (int64, error)
	ReadOnlyTransaction() ReadOnlyTransaction
	ReadWriteTransaction(context.Context, func(context.Context, *ReadWriteTransaction) error) (time.Time, error)
	Single() ReadOnlyTransaction
}

func NewClient

func NewClient(c *spanner.Client) Client

type ClientMock

type ClientMock struct {
	mock.Mock
}

func (*ClientMock) Apply

func (mock *ClientMock) Apply(ctx context.Context, ms []*Mutation, opts ...ApplyOption) (time.Time, error)

func (*ClientMock) BatchReadOnlyTransaction

func (mock *ClientMock) BatchReadOnlyTransaction(ctx context.Context, tb TimestampBound) (BatchReadOnlyTransaction, error)

func (*ClientMock) BatchReadOnlyTransactionFromID

func (mock *ClientMock) BatchReadOnlyTransactionFromID(tid BatchReadOnlyTransactionID) BatchReadOnlyTransaction

func (*ClientMock) Close

func (mock *ClientMock) Close()

func (*ClientMock) PartitionedUpdate

func (mock *ClientMock) PartitionedUpdate(ctx context.Context, statement Statement) (int64, error)

func (*ClientMock) ReadOnlyTransaction

func (mock *ClientMock) ReadOnlyTransaction() ReadOnlyTransaction

func (*ClientMock) ReadWriteTransaction

func (mock *ClientMock) ReadWriteTransaction(
	ctx context.Context, f func(context.Context, *spanner.ReadWriteTransaction) error,
) (time.Time, error)

func (*ClientMock) Single

func (mock *ClientMock) Single() ReadOnlyTransaction

type Key

type Key = spanner.Key

type KeyRange

type KeyRange = spanner.KeyRange

type KeySet

type KeySet = spanner.KeySet

type Mutation

type Mutation = spanner.Mutation

func Delete

func Delete(table string, ks KeySet) *Mutation

func Insert

func Insert(table string, cols []string, vals []interface{}) *Mutation

func InsertMap

func InsertMap(table string, in map[string]interface{}) *Mutation

func InsertOrUpdate

func InsertOrUpdate(table string, cols []string, vals []interface{}) *Mutation

func InsertOrUpdateMap

func InsertOrUpdateMap(table string, in map[string]interface{}) *Mutation

func InsertOrUpdateStruct

func InsertOrUpdateStruct(table string, in interface{}) (*Mutation, error)

func InsertStruct

func InsertStruct(table string, in interface{}) (*Mutation, error)

func Replace

func Replace(table string, cols []string, vals []interface{}) *Mutation

func ReplaceMap

func ReplaceMap(table string, in map[string]interface{}) *Mutation

func ReplaceStruct

func ReplaceStruct(table string, in interface{}) (*Mutation, error)

func Update

func Update(table string, cols []string, vals []interface{}) *Mutation

func UpdateMap

func UpdateMap(table string, in map[string]interface{}) *Mutation

func UpdateStruct

func UpdateStruct(table string, in interface{}) (*Mutation, error)

type Partition

type Partition = spanner.Partition

type PartitionOptions

type PartitionOptions = spanner.PartitionOptions

type QueryPlan

type QueryPlan = sppb.QueryPlan

type ReadOnlyTransaction

type ReadOnlyTransaction interface {
	AnalyzeQuery(context.Context, Statement) (*QueryPlan, error)
	Close()
	Query(context.Context, Statement) RowIterator
	QueryWithStats(context.Context, Statement) RowIterator
	Read(context.Context, string, KeySet, []string) RowIterator
	ReadRow(context.Context, string, Key, []string) (Row, error)
	ReadUsingIndex(context.Context, string, string, KeySet, []string) RowIterator
	ReadWithOptions(context.Context, string, KeySet, []string, *ReadOptions) RowIterator
	Timestamp() (time.Time, error)
	WithTimestampBound(TimestampBound) ReadOnlyTransaction
}

type ReadOnlyTransactionMock

type ReadOnlyTransactionMock struct {
	mock.Mock
}

func (*ReadOnlyTransactionMock) AnalyzeQuery

func (mock *ReadOnlyTransactionMock) AnalyzeQuery(ctx context.Context, statement spanner.Statement) (*QueryPlan, error)

func (*ReadOnlyTransactionMock) Close

func (mock *ReadOnlyTransactionMock) Close()

func (*ReadOnlyTransactionMock) Query

func (*ReadOnlyTransactionMock) QueryWithStats

func (mock *ReadOnlyTransactionMock) QueryWithStats(ctx context.Context, statement Statement) RowIterator

func (*ReadOnlyTransactionMock) Read

func (mock *ReadOnlyTransactionMock) Read(
	ctx context.Context, table string, keys KeySet, columns []string,
) RowIterator

func (*ReadOnlyTransactionMock) ReadRow

func (mock *ReadOnlyTransactionMock) ReadRow(
	ctx context.Context, table string, key spanner.Key, columns []string,
) (Row, error)

func (*ReadOnlyTransactionMock) ReadUsingIndex

func (mock *ReadOnlyTransactionMock) ReadUsingIndex(
	ctx context.Context, table, index string, keys KeySet, columns []string,
) RowIterator

func (*ReadOnlyTransactionMock) ReadWithOptions

func (mock *ReadOnlyTransactionMock) ReadWithOptions(
	ctx context.Context, table string, keys KeySet, columns []string, opts *ReadOptions,
) RowIterator

func (*ReadOnlyTransactionMock) Timestamp

func (mock *ReadOnlyTransactionMock) Timestamp() (time.Time, error)

func (*ReadOnlyTransactionMock) WithTimestampBound

func (mock *ReadOnlyTransactionMock) WithTimestampBound(tb TimestampBound) ReadOnlyTransaction

type ReadOptions

type ReadOptions = spanner.ReadOptions

type ReadWriteTransaction

type ReadWriteTransaction = spanner.ReadWriteTransaction

type Row

type Row interface {
	Column(int, interface{}) error
	ColumnByName(string, interface{}) error
	ColumnIndex(string) (int, error)
	ColumnName(int) string
	ColumnNames() []string
	Columns(...interface{}) error
	Size() int
	ToStruct(interface{}) error
}

type RowIterator

type RowIterator interface {
	Do(func(Row) error) error
	Next() (Row, error)
	Stop()
}

type RowIteratorMock

type RowIteratorMock struct {
	mock.Mock
}

func NewRowIteratorMock

func NewRowIteratorMock() *RowIteratorMock

func (*RowIteratorMock) Do

func (mock *RowIteratorMock) Do(f func(Row) error) error

func (*RowIteratorMock) Next

func (mock *RowIteratorMock) Next() (Row, error)

func (*RowIteratorMock) Stop

func (mock *RowIteratorMock) Stop()

type RowMock

type RowMock struct {
	mock.Mock
}

func NewRowMock

func NewRowMock() *RowMock

func (*RowMock) Column

func (mock *RowMock) Column(i int, ptr interface{}) error

func (*RowMock) ColumnByName

func (mock *RowMock) ColumnByName(name string, ptr interface{}) error

func (*RowMock) ColumnIndex

func (mock *RowMock) ColumnIndex(name string) (int, error)

func (*RowMock) ColumnName

func (mock *RowMock) ColumnName(i int) string

func (*RowMock) ColumnNames

func (mock *RowMock) ColumnNames() []string

func (*RowMock) Columns

func (mock *RowMock) Columns(ptrs ...interface{}) error

func (*RowMock) Size

func (mock *RowMock) Size() int

func (*RowMock) ToStruct

func (mock *RowMock) ToStruct(ptr interface{}) error

type Statement

type Statement = spanner.Statement

type TimestampBound

type TimestampBound = spanner.TimestampBound

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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