Documentation ¶
Index ¶
- func ArgsToParams(args []interface{}) map[string]interface{}
- func Delete[K Keys](db BufferWriter, t tables.Table, keys ...K) error
- func DeleteByBuilder(ctx context.Context, db Updater, b squirrel.DeleteBuilder) (int64, error)
- func ExistsKey[K Key](ctx context.Context, db RowReader, t tables.Table, k K) (bool, error)
- func GetByKey[M any, K Key](ctx context.Context, db RowReader, t tables.Table, k K) (m M, err error)
- func GetByKeys[M any, K Keys](ctx context.Context, db Reader, t tables.Table, ids ...K) ([]M, error)
- func GetPtrResults[M any](iter *spanner.RowIterator) (out []*M, err error)
- func GetResult[M any](iter *spanner.RowIterator) (out M, err error)
- func GetResultByBuilder[M any](ctx context.Context, db Queryer, b squirrel.SelectBuilder) (m M, err error)
- func GetResults[M any](iter *spanner.RowIterator) (out []M, err error)
- func GetResultsByBuilder[M any](ctx context.Context, db Queryer, b squirrel.SelectBuilder) ([]M, error)
- func GetStreak(ctx context.Context, db Queryer, userID string, streakType int64) ([]repo.Streak, error)
- func GetStreaksHistory(ctx context.Context, db Queryer, userID string, streakType int64, ...) ([]repo.Streak, error)
- func InsertByBuilder(ctx context.Context, db Updater, b squirrel.InsertBuilder) (int64, error)
- func NewSpannerClient(ctx context.Context, dsn, adcCredPath string) (*spanner.Client, error)
- func UpdateByBuilder(ctx context.Context, db Updater, b squirrel.UpdateBuilder) (int64, error)
- func UpsertStreak(_ context.Context, db BufferWriter, in repo.Streak) error
- type BufferWriter
- type DBWriter
- type IndexReader
- type Key
- type Keys
- type Queryer
- type ReadWriter
- type Reader
- type Repo
- func (r Repo) ReadOnlyTx(ctx context.Context, f func(context.Context, repo.ReadActions) error) error
- func (r Repo) ReadWriteTx(ctx context.Context, f func(context.Context, repo.ReadWriteActions) error) (time.Time, error)
- func (r Repo) SingleRead() repo.ReadActions
- func (r Repo) SingleWrite() repo.WriteActions
- type RowReader
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsToParams ¶
func ArgsToParams(args []interface{}) map[string]interface{}
func DeleteByBuilder ¶
func GetPtrResults ¶
func GetPtrResults[M any](iter *spanner.RowIterator) (out []*M, err error)
GetPtrResults returns the results from the iterator. Calls Stop after the iterator is finished.
func GetResult ¶
func GetResult[M any](iter *spanner.RowIterator) (out M, err error)
GetResult returns the result from the iterator. Calls Stop after the iterator is finished.
func GetResultByBuilder ¶
func GetResults ¶
func GetResults[M any](iter *spanner.RowIterator) (out []M, err error)
GetResults returns the results from the iterator. Calls Stop after the iterator is finished.
func GetResultsByBuilder ¶
func GetStreaksHistory ¶
func InsertByBuilder ¶
func NewSpannerClient ¶
func UpdateByBuilder ¶
func UpsertStreak ¶
Types ¶
type BufferWriter ¶
type DBWriter ¶
type DBWriter interface { Updater BufferWriter }
type IndexReader ¶
type ReadWriter ¶
type ReadWriter interface { Reader BufferWriter }
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func NewRepoWithClient ¶
func (Repo) ReadOnlyTx ¶
func (Repo) ReadWriteTx ¶
func (Repo) SingleRead ¶
func (r Repo) SingleRead() repo.ReadActions
func (Repo) SingleWrite ¶
func (r Repo) SingleWrite() repo.WriteActions
Source Files ¶
Click to show internal directories.
Click to hide internal directories.