dsinterface

package module
v0.0.0-...-d71dbf0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT-0 Imports: 2 Imported by: 0

Documentation

Overview

Package dsif was generated by GoLand from the Google datastore.Client structure to allow it's functionality to be mocked in unit tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatastoreClient

type DatastoreClient interface {
	AllocateIDs(ctx context.Context, keys []*datastore.Key) ([]*datastore.Key, error)
	Close() error
	Get(ctx context.Context, key *datastore.Key, dst interface{}) (err error)
	GetMulti(ctx context.Context, keys []*datastore.Key, dst interface{}) (err error)
	Put(ctx context.Context, key *datastore.Key, src interface{}) (*datastore.Key, error)
	PutMulti(ctx context.Context, keys []*datastore.Key, src interface{}) (ret []*datastore.Key, err error)
	Delete(ctx context.Context, key *datastore.Key) error
	DeleteMulti(ctx context.Context, keys []*datastore.Key) (err error)
	Mutate(ctx context.Context, muts ...*datastore.Mutation) (ret []*datastore.Key, err error)
	NewTransaction(ctx context.Context, opts ...datastore.TransactionOption) (t *datastore.Transaction, err error)
	RunInTransaction(ctx context.Context, f func(tx *datastore.Transaction) error, opts ...datastore.TransactionOption) (cmt *datastore.Commit, err error)
	Count(ctx context.Context, q *datastore.Query) (n int, err error)
	GetAll(ctx context.Context, q *datastore.Query, dst interface{}) (keys []*datastore.Key, err error)
	Run(ctx context.Context, q *datastore.Query) *datastore.Iterator
}

DatastoreClient is an interface that maps all the methods found in the Google datastore.Client allowing that client to be mocked by unit tests.

Jump to

Keyboard shortcuts

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