meta

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package meta contains some methods for interacting with GAE's metadata APIs. It only contains an implementation for those metadata APIs we've needed so far, but should be extended to support new ones in the case that we use them.

See metadata docs: https://cloud.google.com/appengine/docs/python/datastore/metadataentityclasses#EntityGroup

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntityGroupVersion

func GetEntityGroupVersion(c context.Context, key *ds.Key) (int64, error)

GetEntityGroupVersion returns the entity group version for the entity group containing root. If the entity group doesn't exist, this function will return zero and a nil error.

func Namespaces

func Namespaces(c context.Context, cb NamespacesCallback) error

Namespaces returns a list of all of the namespaces in the datastore.

This is done by issuing a datastore query for kind "__namespace__". The resulting keys will have IDs for the namespaces, namely:

  • The empty namespace will have integer ID 1. This will be forwarded to the callback as "".
  • Other namespaces will have non-zero string IDs.

func NamespacesWithPrefix

func NamespacesWithPrefix(c context.Context, p string, cb NamespacesCallback) error

NamespacesWithPrefix runs Namespaces, returning only namespaces beginning with the supplied prefix string.

Types

type EntityGroupMeta

type EntityGroupMeta struct {
	Parent *ds.Key `gae:"$parent"`

	Version int64 `gae:"__version__"`
	// contains filtered or unexported fields
}

EntityGroupMeta is the model corresponding to the __entity_group__ model in appengine. You shouldn't need to use this struct directly, but instead should use GetEntityGroupVersion.

type NamespacesCallback

type NamespacesCallback func(string) error

NamespacesCallback is the callback type used with Namespaces. The callback will be invoked with each identified namespace.

If the callback returns an error, iteration will stop. If the error is datastore.Stop, Namespaces will stop iterating and return nil. Otherwise, the error will be forwarded.

type NamespacesCollector

type NamespacesCollector []string

NamespacesCollector exposes a NamespacesCallback function that aggregates resulting namespaces into the collector slice.

func (*NamespacesCollector) Callback

func (c *NamespacesCollector) Callback(v string) error

Callback is a NamespacesCallback which adds each namespace to the collector.

Jump to

Keyboard shortcuts

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