Documentation ¶
Index ¶
- func NewTransactor(spannerClient *spanner.Client) gotx.Transactor
- func NewTransactorWithConfig(spannerClient *spanner.Client, config TransactorConfig) gotx.Transactor
- type Client
- type ClientFactory
- type ClientProvider
- type DefaultClient
- func (e *DefaultClient) ApplyOrBufferWrite(ctx context.Context, data ...*spanner.Mutation) error
- func (e *DefaultClient) BatchUpdate(ctx context.Context, stmts []spanner.Statement) ([]int64, error)
- func (e *DefaultClient) PartitionedUpdate(ctx context.Context, stmt spanner.Statement) (int64, error)
- func (e *DefaultClient) PartitionedUpdateWithOptions(ctx context.Context, stmt spanner.Statement, options spanner.QueryOptions) (int64, error)
- func (e *DefaultClient) Reader(_ context.Context) Reader
- func (e *DefaultClient) Update(ctx context.Context, stmt spanner.Statement) (int64, error)
- func (e *DefaultClient) UpdateWithOption(ctx context.Context, stmt spanner.Statement, opts spanner.QueryOptions) (int64, error)
- type DefaultClientFactory
- type DefaultClientProvider
- type Reader
- type TransactionOptions
- type Transactor
- type TransactorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTransactor ¶
func NewTransactor(spannerClient *spanner.Client) gotx.Transactor
func NewTransactorWithConfig ¶
func NewTransactorWithConfig(spannerClient *spanner.Client, config TransactorConfig) gotx.Transactor
Types ¶
type Client ¶
type Client interface { Reader(ctx context.Context) Reader ApplyOrBufferWrite(context.Context, ...*spanner.Mutation) error Update(ctx context.Context, statement spanner.Statement) (int64, error) UpdateWithOption(ctx context.Context, statement spanner.Statement, options spanner.QueryOptions) (int64, error) BatchUpdate(ctx context.Context, statement []spanner.Statement) ([]int64, error) PartitionedUpdate(ctx context.Context, statement spanner.Statement) (int64, error) PartitionedUpdateWithOptions(ctx context.Context, statement spanner.Statement, options spanner.QueryOptions) (int64, error) }
func NewDefaultClient ¶
func NewDefaultClient(client *spanner.Client, rw *spanner.ReadWriteTransaction, ro *spanner.ReadOnlyTransaction) Client
type ClientFactory ¶
type ClientFactory interface {
NewClient(client *spanner.Client, rw *spanner.ReadWriteTransaction, ro *spanner.ReadOnlyTransaction) Client
}
type ClientProvider ¶
func NewDefaultClientProvider ¶
func NewDefaultClientProvider(client *spanner.Client) ClientProvider
func NewDefaultClientProviderWithFactory ¶
func NewDefaultClientProviderWithFactory(client *spanner.Client, factory ClientFactory) ClientProvider
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func (*DefaultClient) ApplyOrBufferWrite ¶
func (*DefaultClient) BatchUpdate ¶
func (*DefaultClient) PartitionedUpdate ¶
func (*DefaultClient) PartitionedUpdateWithOptions ¶
func (e *DefaultClient) PartitionedUpdateWithOptions(ctx context.Context, stmt spanner.Statement, options spanner.QueryOptions) (int64, error)
func (*DefaultClient) UpdateWithOption ¶
func (e *DefaultClient) UpdateWithOption(ctx context.Context, stmt spanner.Statement, opts spanner.QueryOptions) (int64, error)
type DefaultClientFactory ¶
type DefaultClientFactory struct { }
func (*DefaultClientFactory) NewClient ¶
func (c *DefaultClientFactory) NewClient(client *spanner.Client, rw *spanner.ReadWriteTransaction, ro *spanner.ReadOnlyTransaction) Client
type DefaultClientProvider ¶
type DefaultClientProvider struct {
// contains filtered or unexported fields
}
func (*DefaultClientProvider) CurrentClient ¶
func (p *DefaultClientProvider) CurrentClient(ctx context.Context) Client
type Reader ¶
type Reader interface { Read(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator ReadUsingIndex(ctx context.Context, table, index string, keys spanner.KeySet, columns []string) (ri *spanner.RowIterator) Query(ctx context.Context, statement spanner.Statement) *spanner.RowIterator QueryWithOptions(ctx context.Context, statement spanner.Statement, opts spanner.QueryOptions) *spanner.RowIterator QueryWithStats(ctx context.Context, statement spanner.Statement) *spanner.RowIterator ReadRow(ctx context.Context, table string, key spanner.Key, columns []string) (*spanner.Row, error) }
------------------------------------ Client ------------------------------------
type TransactionOptions ¶
type TransactionOptions spanner.TransactionOptions
func OptionTransactionOptions ¶
func OptionTransactionOptions(options spanner.TransactionOptions) TransactionOptions
func (TransactionOptions) Apply ¶
func (o TransactionOptions) Apply(c *gotx.Config)
type Transactor ¶
type Transactor struct {
// contains filtered or unexported fields
}
func (*Transactor) Required ¶
func (t *Transactor) Required(ctx context.Context, fn gotx.DoInTransaction, options ...gotx.Option) error
func (*Transactor) RequiresNew ¶
func (t *Transactor) RequiresNew(ctx context.Context, fn gotx.DoInTransaction, options ...gotx.Option) error
type TransactorConfig ¶
type TransactorConfig struct { ClientFactory ClientFactory OnCommit func(commitResponse *spanner.CommitResponse) }
Click to show internal directories.
Click to hide internal directories.