datastore

package
v0.0.0-...-360b30e Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client TranslatorClient, keyKind string, valueKind string) storage.Storage

New creates a Storage persisted in Google Cloud Datastore

Types

type Item

type Item struct {
	Data string
}

Item represents a Google Cloud Datastore entity

type Transaction

type Transaction interface {
	Get(*datastore.Key, interface{}) error
	Put(*datastore.Key, interface{}) (*datastore.PendingKey, error)
}

Transaction represents a Google Cloud Datastore transaction

type TranslatorClient

type TranslatorClient interface {
	RunInTransaction(context.Context, func(Transaction) error, ...datastore.TransactionOption) (*datastore.Commit, error)
	Get(context.Context, *datastore.Key, interface{}) error
}

TranslatorClient is a wrapper necessary to write tests around transactions

func NewTranslator

func NewTranslator(client *datastore.Client) TranslatorClient

NewTranslator returns a TranslatorClient

Jump to

Keyboard shortcuts

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