appengine: google.golang.org/appengine/datastore/internal/cloudkey Index | Files

package cloudkey

import "google.golang.org/appengine/datastore/internal/cloudkey"

Package cloudpb is a subset of types and functions, copied from cloud.google.com/go/datastore.

They are copied here to provide compatibility to decode keys generated by the cloud.google.com/go/datastore package.

Index

Package Files

cloudkey.go

Variables

var (
    // ErrInvalidKey is returned when an invalid key is presented.
    ErrInvalidKey = errors.New("datastore: invalid key")
)

type Key Uses

type Key struct {
    // Kind cannot be empty.
    Kind string
    // Either ID or Name must be zero for the Key to be valid.
    // If both are zero, the Key is incomplete.
    ID   int64
    Name string
    // Parent must either be a complete Key or nil.
    Parent *Key

    // Namespace provides the ability to partition your data for multiple
    // tenants. In most cases, it is not necessary to specify a namespace.
    // See docs on datastore multitenancy for details:
    // https://cloud.google.com/datastore/docs/concepts/multitenancy
    Namespace string
}

Key represents the datastore key for a stored entity.

func DecodeKey Uses

func DecodeKey(encoded string) (*Key, error)

DecodeKey decodes a key from the opaque representation returned by Encode.

func (*Key) Incomplete Uses

func (k *Key) Incomplete() bool

Incomplete reports whether the key does not refer to a stored entity.

Package cloudkey imports 5 packages (graph) and is imported by 1 packages. Updated 2019-05-15. Refresh now. Tools for package owners.