ds

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

ds is a package for using Google Cloud Datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DS

type DS struct {
	// Client is the Cloud Datastore client.
	Client *datastore.Client

	// Namespace is the datastore namespace that data will be stored in.
	Namespace string
}

func New

func New(ctx context.Context, project string, ns string) (*DS, error)

New creates a new Cloud Datastore Client (*DS).

ctx - The Context to use when creating the client. project - The project name, i.e. "google.com:skia-buildbots". ns - The datastore namespace to store data into.

func (*DS) NewKey

func (ds *DS) NewKey(kind Kind) *datastore.Key

NewKey a new indeterminate key of the given kind with the right namespace.

func (*DS) NewKeyWithParent

func (ds *DS) NewKeyWithParent(kind Kind, parent *datastore.Key) *datastore.Key

NewKey a new indeterminate key of the given kind with the given parent with the right namespace.

func (*DS) NewQuery

func (ds *DS) NewQuery(kind Kind) *datastore.Query

NewQuery creates a new query of the given kind with the right namespace.

type Kind

type Kind string

Jump to

Keyboard shortcuts

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