cloudkey

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Key

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

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

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

func (*Key) Incomplete

func (k *Key) Incomplete() bool

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

Jump to

Keyboard shortcuts

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