Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
NewClient(ctx context.Context, projectID string) (*datastore.Client, error)
}
Backend is an abstraction over {Local, Prod}Datastore that allows callers to construct a new client without having to know about whether it's local.
type LocalBackend ¶
type LocalBackend struct {
// contains filtered or unexported fields
}
LocalBackend represents an emulated Google Cloud Datastore running on localhost
func NewLocalBackend ¶
func NewLocalBackend() (db LocalBackend, shutdown func() error, err error)
NewLocalBackend spawns a new LocalBackend using Java. When there is no error, make sure to call shutdown() in order to terminate the Java process.
func (LocalBackend) NewClient ¶
NewClient constructs a datastore client for the emulated LocalBackend. The constructed client will work offline and never connect to the wide internet.
func (LocalBackend) Reset ¶
func (db LocalBackend) Reset() error
Reset resets the local backend to an empty database.
type ProdBackend ¶
type ProdBackend struct{}
ProdBackend represents the production instance of Google Cloud Datastore
func NewProdBackend ¶
func NewProdBackend() (db ProdBackend)
NewProdBackend constructs a new ProdBackend.