cmd

package
v0.0.0-...-51e8c80 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version  string
	Revision string
)
View Source
var RootCmd = &cobra.Command{
	Use:           "datastore-tools",
	Short:         "CLI for Google Cloud Datastore",
	SilenceErrors: true,
	SilenceUsage:  false,
}

Functions

This section is empty.

Types

type DatastoreClient

type DatastoreClient interface {
	GetQuery(kind, namespace, filter string, keysOnly bool) (*datastore.Query, error)
	GetAll(ctx context.Context, query *datastore.Query, entities *[]Entity) ([]*datastore.Key, error)
	PutMulti(ctx context.Context, keys []*datastore.Key, entities []Entity) ([]*datastore.Key, error)
	DeleteMulti(ctx context.Context, keys []*datastore.Key) error
}

func NewDatastoreClient

func NewDatastoreClient(c context.Context, keyfile, project string) (DatastoreClient, error)

type DatastoreClientImpl

type DatastoreClientImpl struct {
	Client *datastore.Client
}

func (*DatastoreClientImpl) DeleteMulti

func (c *DatastoreClientImpl) DeleteMulti(ctx context.Context, keys []*datastore.Key) error

func (*DatastoreClientImpl) GetAll

func (c *DatastoreClientImpl) GetAll(ctx context.Context, query *datastore.Query, entities *[]Entity) ([]*datastore.Key, error)

func (*DatastoreClientImpl) GetQuery

func (c *DatastoreClientImpl) GetQuery(kind, namespace, filter string, keysOnly bool) (*datastore.Query, error)

func (*DatastoreClientImpl) PutMulti

func (c *DatastoreClientImpl) PutMulti(ctx context.Context, keys []*datastore.Key, entities []Entity) ([]*datastore.Key, error)

type Entity

type Entity struct {
	Props      map[string]interface{}
	Properties []datastore.Property
}

func (*Entity) Load

func (e *Entity) Load(ps []datastore.Property) error

func (*Entity) Save

func (e *Entity) Save() ([]datastore.Property, error)

func (*Entity) SetValue

func (e *Entity) SetValue(name, value string) error

type JsonKey

type JsonKey struct {
	Kind      string
	ID        int64
	Name      string
	Namespace string
}

func NewJsonKey

func NewJsonKey(key *datastore.Key) *JsonKey

type Options

type Options struct {
	OptProject   string
	OptKind      string
	OptNamespace string
	OptKeyFile   string
	OptFilter    string
	OptSet       string
	OptCount     bool
	OptTable     bool
}

Jump to

Keyboard shortcuts

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