datastoredata

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package datastoredata provides Cloud Firestore type definitions for CloudEvent data payloads.

Supported CloudEvent Types

  • google.cloud.datastore.entity.v1.created
  • google.cloud.datastore.entity.v1.updated
  • google.cloud.datastore.entity.v1.deleted
  • google.cloud.datastore.entity.v1.written
  • google.cloud.datastore.entity.v1.created.withAuthContext
  • google.cloud.datastore.entity.v1.updated.withAuthContext
  • google.cloud.datastore.entity.v1.deleted.withAuthContext
  • google.cloud.datastore.entity.v1.written.withAuthContext

Index

Constants

This section is empty.

Variables

View Source
var (
	EntityResult_ResultType_name = map[int32]string{
		0: "RESULT_TYPE_UNSPECIFIED",
		1: "FULL",
		2: "PROJECTION",
		3: "KEY_ONLY",
	}
	EntityResult_ResultType_value = map[string]int32{
		"RESULT_TYPE_UNSPECIFIED": 0,
		"FULL":                    1,
		"PROJECTION":              2,
		"KEY_ONLY":                3,
	}
)

Enum value maps for EntityResult_ResultType.

View Source
var File_cloud_datastore_v1_data_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ArrayValue

type ArrayValue struct {

	// Values in the array.
	// The order of values in an array is preserved as long as all values have
	// identical settings for 'exclude_from_indexes'.
	Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

An array value.

func (*ArrayValue) Descriptor deprecated

func (*ArrayValue) Descriptor() ([]byte, []int)

Deprecated: Use ArrayValue.ProtoReflect.Descriptor instead.

func (*ArrayValue) GetValues

func (x *ArrayValue) GetValues() []*Value

func (*ArrayValue) ProtoMessage

func (*ArrayValue) ProtoMessage()

func (*ArrayValue) ProtoReflect

func (x *ArrayValue) ProtoReflect() protoreflect.Message

func (*ArrayValue) Reset

func (x *ArrayValue) Reset()

func (*ArrayValue) String

func (x *ArrayValue) String() string

type Entity

type Entity struct {

	// The entity's key.
	//
	// An entity must have a key, unless otherwise documented (for example,
	// an entity in `Value.entity_value` may have no key).
	// An entity's kind is its key path's last element's kind,
	// or null if it has no key.
	Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The entity's properties.
	// The map's keys are property names.
	// A property name matching regex `__.*__` is reserved.
	// A reserved property name is forbidden in certain documented contexts.
	// The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
	// be empty.
	Properties map[string]*Value `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

A Datastore data object.

Must not exceed 1 MiB - 4 bytes.

func (*Entity) Descriptor deprecated

func (*Entity) Descriptor() ([]byte, []int)

Deprecated: Use Entity.ProtoReflect.Descriptor instead.

func (*Entity) GetKey

func (x *Entity) GetKey() *Key

func (*Entity) GetProperties

func (x *Entity) GetProperties() map[string]*Value

func (*Entity) ProtoMessage

func (*Entity) ProtoMessage()

func (*Entity) ProtoReflect

func (x *Entity) ProtoReflect() protoreflect.Message

func (*Entity) Reset

func (x *Entity) Reset()

func (*Entity) String

func (x *Entity) String() string

type EntityEventData

type EntityEventData struct {

	// An EntityResult object containing a post-operation entity snapshot.
	// This is not populated for delete events.
	Value *EntityResult `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// An EntityResult object containing a pre-operation entity snapshot.
	// This is only populated for update and delete events.
	OldValue *EntityResult `protobuf:"bytes,2,opt,name=old_value,json=oldValue,proto3" json:"old_value,omitempty"`
	// A PropertyMask object that lists changed properties.
	// This is only populated for update events..
	UpdateMask *PropertyMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

The data within all Firestore in Datastore Mode entity events.

func (*EntityEventData) Descriptor deprecated

func (*EntityEventData) Descriptor() ([]byte, []int)

Deprecated: Use EntityEventData.ProtoReflect.Descriptor instead.

func (*EntityEventData) GetOldValue

func (x *EntityEventData) GetOldValue() *EntityResult

func (*EntityEventData) GetUpdateMask

func (x *EntityEventData) GetUpdateMask() *PropertyMask

func (*EntityEventData) GetValue

func (x *EntityEventData) GetValue() *EntityResult

func (*EntityEventData) ProtoMessage

func (*EntityEventData) ProtoMessage()

func (*EntityEventData) ProtoReflect

func (x *EntityEventData) ProtoReflect() protoreflect.Message

func (*EntityEventData) Reset

func (x *EntityEventData) Reset()

func (*EntityEventData) String

func (x *EntityEventData) String() string

type EntityResult

type EntityResult struct {

	// The resulting entity.
	Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
	// The version of the entity, a strictly positive number that monotonically
	// increases with changes to the entity.
	//
	// This field is set for
	// [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results.
	//
	// For [missing][google.datastore.v1.LookupResponse.missing] entities in
	// `LookupResponse`, this is the version of the snapshot that was used to look
	// up the entity, and it is always set except for eventually consistent reads.
	Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
	// The time at which the entity was created.
	// This field is set for
	// [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results.
	// If this entity is missing, this field will not be set.
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// The time at which the entity was last changed.
	// This field is set for
	// [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results.
	// If this entity is missing, this field will not be set.
	UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// A cursor that points to the position after the result entity.
	// Set only when the `EntityResult` is part of a `QueryResultBatch` message.
	Cursor []byte `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

The result of fetching an entity from Datastore.

func (*EntityResult) Descriptor deprecated

func (*EntityResult) Descriptor() ([]byte, []int)

Deprecated: Use EntityResult.ProtoReflect.Descriptor instead.

func (*EntityResult) GetCreateTime

func (x *EntityResult) GetCreateTime() *timestamppb.Timestamp

func (*EntityResult) GetCursor

func (x *EntityResult) GetCursor() []byte

func (*EntityResult) GetEntity

func (x *EntityResult) GetEntity() *Entity

func (*EntityResult) GetUpdateTime

func (x *EntityResult) GetUpdateTime() *timestamppb.Timestamp

func (*EntityResult) GetVersion

func (x *EntityResult) GetVersion() int64

func (*EntityResult) ProtoMessage

func (*EntityResult) ProtoMessage()

func (*EntityResult) ProtoReflect

func (x *EntityResult) ProtoReflect() protoreflect.Message

func (*EntityResult) Reset

func (x *EntityResult) Reset()

func (*EntityResult) String

func (x *EntityResult) String() string

type EntityResult_ResultType

type EntityResult_ResultType int32

Specifies what data the 'entity' field contains. A `ResultType` is either implied (for example, in `LookupResponse.missing` from `datastore.proto`, it is always `KEY_ONLY`) or specified by context (for example, in message `QueryResultBatch`, field `entity_result_type` specifies a `ResultType` for all the values in field `entity_results`).

const (
	// Unspecified. This value is never used.
	EntityResult_RESULT_TYPE_UNSPECIFIED EntityResult_ResultType = 0
	// The key and properties.
	EntityResult_FULL EntityResult_ResultType = 1
	// A projected subset of properties. The entity may have no key.
	EntityResult_PROJECTION EntityResult_ResultType = 2
	// Only the key.
	EntityResult_KEY_ONLY EntityResult_ResultType = 3
)

func (EntityResult_ResultType) Descriptor

func (EntityResult_ResultType) Enum

func (EntityResult_ResultType) EnumDescriptor deprecated

func (EntityResult_ResultType) EnumDescriptor() ([]byte, []int)

Deprecated: Use EntityResult_ResultType.Descriptor instead.

func (EntityResult_ResultType) Number

func (EntityResult_ResultType) String

func (x EntityResult_ResultType) String() string

func (EntityResult_ResultType) Type

type Key

type Key struct {

	// Entities are partitioned into subsets, currently identified by a project
	// ID and namespace ID.
	// Queries are scoped to a single partition.
	PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"`
	// The entity path.
	// An entity path consists of one or more elements composed of a kind and a
	// string or numerical identifier, which identify entities. The first
	// element identifies a _root entity_, the second element identifies
	// a _child_ of the root entity, the third element identifies a child of the
	// second entity, and so forth. The entities identified by all prefixes of
	// the path are called the element's _ancestors_.
	//
	// An entity path is always fully complete: *all* of the entity's ancestors
	// are required to be in the path along with the entity identifier itself.
	// The only exception is that in some documented cases, the identifier in the
	// last path element (for the entity) itself may be omitted. For example,
	// the last path element of the key of `Mutation.insert` may have no
	// identifier.
	//
	// A path can never be empty, and a path can have at most 100 elements.
	Path []*Key_PathElement `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

A unique identifier for an entity. If a key's partition ID or any of its path kinds or names are reserved/read-only, the key is reserved/read-only. A reserved/read-only key is forbidden in certain documented contexts.

func (*Key) Descriptor deprecated

func (*Key) Descriptor() ([]byte, []int)

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetPartitionId

func (x *Key) GetPartitionId() *PartitionId

func (*Key) GetPath

func (x *Key) GetPath() []*Key_PathElement

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

func (x *Key) ProtoReflect() protoreflect.Message

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

type Key_PathElement

type Key_PathElement struct {

	// The kind of the entity.
	//
	// A kind matching regex `__.*__` is reserved/read-only.
	// A kind must not contain more than 1500 bytes when UTF-8 encoded.
	// Cannot be `""`.
	//
	// Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
	// encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the
	// bytes.
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// The type of ID.
	//
	// Types that are assignable to IdType:
	//
	//	*Key_PathElement_Id
	//	*Key_PathElement_Name
	IdType isKey_PathElement_IdType `protobuf_oneof:"id_type"`
	// contains filtered or unexported fields
}

A (kind, ID/name) pair used to construct a key path.

If either name or ID is set, the element is complete. If neither is set, the element is incomplete.

func (*Key_PathElement) Descriptor deprecated

func (*Key_PathElement) Descriptor() ([]byte, []int)

Deprecated: Use Key_PathElement.ProtoReflect.Descriptor instead.

func (*Key_PathElement) GetId

func (x *Key_PathElement) GetId() int64

func (*Key_PathElement) GetIdType

func (m *Key_PathElement) GetIdType() isKey_PathElement_IdType

func (*Key_PathElement) GetKind

func (x *Key_PathElement) GetKind() string

func (*Key_PathElement) GetName

func (x *Key_PathElement) GetName() string

func (*Key_PathElement) ProtoMessage

func (*Key_PathElement) ProtoMessage()

func (*Key_PathElement) ProtoReflect

func (x *Key_PathElement) ProtoReflect() protoreflect.Message

func (*Key_PathElement) Reset

func (x *Key_PathElement) Reset()

func (*Key_PathElement) String

func (x *Key_PathElement) String() string

type Key_PathElement_Id

type Key_PathElement_Id struct {
	// The auto-allocated ID of the entity.
	//
	// Never equal to zero. Values less than zero are discouraged and may not
	// be supported in the future.
	Id int64 `protobuf:"varint,2,opt,name=id,proto3,oneof"`
}

type Key_PathElement_Name

type Key_PathElement_Name struct {
	// The name of the entity.
	//
	// A name matching regex `__.*__` is reserved/read-only.
	// A name must not be more than 1500 bytes when UTF-8 encoded.
	// Cannot be `""`.
	//
	// Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
	// encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the
	// bytes.
	Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"`
}

type PartitionId

type PartitionId struct {

	// The ID of the project to which the entities belong.
	ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// If not empty, the ID of the database to which the entities
	// belong.
	DatabaseId string `protobuf:"bytes,3,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"`
	// If not empty, the ID of the namespace to which the entities belong.
	NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"`
	// contains filtered or unexported fields
}

A partition ID identifies a grouping of entities. The grouping is always by project and namespace, however the namespace ID may be empty.

A partition ID contains several dimensions: project ID and namespace ID.

Partition dimensions:

- May be `""`. - Must be valid UTF-8 bytes. - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any dimension matches regex `__.*__`, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts.

Foreign partition IDs (in which the project ID does not match the context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state.

func (*PartitionId) Descriptor deprecated

func (*PartitionId) Descriptor() ([]byte, []int)

Deprecated: Use PartitionId.ProtoReflect.Descriptor instead.

func (*PartitionId) GetDatabaseId

func (x *PartitionId) GetDatabaseId() string

func (*PartitionId) GetNamespaceId

func (x *PartitionId) GetNamespaceId() string

func (*PartitionId) GetProjectId

func (x *PartitionId) GetProjectId() string

func (*PartitionId) ProtoMessage

func (*PartitionId) ProtoMessage()

func (*PartitionId) ProtoReflect

func (x *PartitionId) ProtoReflect() protoreflect.Message

func (*PartitionId) Reset

func (x *PartitionId) Reset()

func (*PartitionId) String

func (x *PartitionId) String() string

type PropertyMask

type PropertyMask struct {

	// The list of property paths in the mask.
	// This is not populated for delete events.
	PropertyPaths []string `protobuf:"bytes,1,rep,name=property_paths,json=propertyPaths,proto3" json:"property_paths,omitempty"`
	// contains filtered or unexported fields
}

A set of property paths on an entity.

func (*PropertyMask) Descriptor deprecated

func (*PropertyMask) Descriptor() ([]byte, []int)

Deprecated: Use PropertyMask.ProtoReflect.Descriptor instead.

func (*PropertyMask) GetPropertyPaths

func (x *PropertyMask) GetPropertyPaths() []string

func (*PropertyMask) ProtoMessage

func (*PropertyMask) ProtoMessage()

func (*PropertyMask) ProtoReflect

func (x *PropertyMask) ProtoReflect() protoreflect.Message

func (*PropertyMask) Reset

func (x *PropertyMask) Reset()

func (*PropertyMask) String

func (x *PropertyMask) String() string

type Value

type Value struct {

	// Must have a value set.
	//
	// Types that are assignable to ValueType:
	//
	//	*Value_NullValue
	//	*Value_BooleanValue
	//	*Value_IntegerValue
	//	*Value_DoubleValue
	//	*Value_TimestampValue
	//	*Value_KeyValue
	//	*Value_StringValue
	//	*Value_BlobValue
	//	*Value_GeoPointValue
	//	*Value_EntityValue
	//	*Value_ArrayValue
	ValueType isValue_ValueType `protobuf_oneof:"value_type"`
	// The `meaning` field should only be populated for backwards compatibility.
	Meaning int32 `protobuf:"varint,14,opt,name=meaning,proto3" json:"meaning,omitempty"`
	// If the value should be excluded from all indexes including those defined
	// explicitly.
	ExcludeFromIndexes bool `protobuf:"varint,19,opt,name=exclude_from_indexes,json=excludeFromIndexes,proto3" json:"exclude_from_indexes,omitempty"`
	// contains filtered or unexported fields
}

A message that can hold any of the supported value types and associated metadata.

func (*Value) Descriptor deprecated

func (*Value) Descriptor() ([]byte, []int)

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetArrayValue

func (x *Value) GetArrayValue() *ArrayValue

func (*Value) GetBlobValue

func (x *Value) GetBlobValue() []byte

func (*Value) GetBooleanValue

func (x *Value) GetBooleanValue() bool

func (*Value) GetDoubleValue

func (x *Value) GetDoubleValue() float64

func (*Value) GetEntityValue

func (x *Value) GetEntityValue() *Entity

func (*Value) GetExcludeFromIndexes

func (x *Value) GetExcludeFromIndexes() bool

func (*Value) GetGeoPointValue

func (x *Value) GetGeoPointValue() *latlng.LatLng

func (*Value) GetIntegerValue

func (x *Value) GetIntegerValue() int64

func (*Value) GetKeyValue

func (x *Value) GetKeyValue() *Key

func (*Value) GetMeaning

func (x *Value) GetMeaning() int32

func (*Value) GetNullValue

func (x *Value) GetNullValue() structpb.NullValue

func (*Value) GetStringValue

func (x *Value) GetStringValue() string

func (*Value) GetTimestampValue

func (x *Value) GetTimestampValue() *timestamppb.Timestamp

func (*Value) GetValueType

func (m *Value) GetValueType() isValue_ValueType

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

func (x *Value) ProtoReflect() protoreflect.Message

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

type Value_ArrayValue

type Value_ArrayValue struct {
	// An array value.
	// Cannot contain another array value.
	// A `Value` instance that sets field `array_value` must not set fields
	// `meaning` or `exclude_from_indexes`.
	ArrayValue *ArrayValue `protobuf:"bytes,9,opt,name=array_value,json=arrayValue,proto3,oneof"`
}

type Value_BlobValue

type Value_BlobValue struct {
	// A blob value.
	// May have at most 1,000,000 bytes.
	// When `exclude_from_indexes` is false, may have at most 1500 bytes.
	// In JSON requests, must be base64-encoded.
	BlobValue []byte `protobuf:"bytes,18,opt,name=blob_value,json=blobValue,proto3,oneof"`
}

type Value_BooleanValue

type Value_BooleanValue struct {
	// A boolean value.
	BooleanValue bool `protobuf:"varint,1,opt,name=boolean_value,json=booleanValue,proto3,oneof"`
}

type Value_DoubleValue

type Value_DoubleValue struct {
	// A double value.
	DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type Value_EntityValue

type Value_EntityValue struct {
	// An entity value.
	//
	// - May have no key.
	// - May have a key with an incomplete key path.
	// - May have a reserved/read-only key.
	EntityValue *Entity `protobuf:"bytes,6,opt,name=entity_value,json=entityValue,proto3,oneof"`
}

type Value_GeoPointValue

type Value_GeoPointValue struct {
	// A geo point value representing a point on the surface of Earth.
	GeoPointValue *latlng.LatLng `protobuf:"bytes,8,opt,name=geo_point_value,json=geoPointValue,proto3,oneof"`
}

type Value_IntegerValue

type Value_IntegerValue struct {
	// An integer value.
	IntegerValue int64 `protobuf:"varint,2,opt,name=integer_value,json=integerValue,proto3,oneof"`
}

type Value_KeyValue

type Value_KeyValue struct {
	// A key value.
	KeyValue *Key `protobuf:"bytes,5,opt,name=key_value,json=keyValue,proto3,oneof"`
}

type Value_NullValue

type Value_NullValue struct {
	// A null value.
	NullValue structpb.NullValue `protobuf:"varint,11,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
}

type Value_StringValue

type Value_StringValue struct {
	// A UTF-8 encoded string value.
	// When `exclude_from_indexes` is false (it is indexed) , may have at most
	// 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes.
	StringValue string `protobuf:"bytes,17,opt,name=string_value,json=stringValue,proto3,oneof"`
}

type Value_TimestampValue

type Value_TimestampValue struct {
	// A timestamp value.
	// When stored in the Datastore, precise only to microseconds;
	// any additional precision is rounded down.
	TimestampValue *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=timestamp_value,json=timestampValue,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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