datastore

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewInsert = datastore.NewInsert
	NewUpdate = datastore.NewUpdate
)
View Source
var ErrNoSuchEntity = datastore.ErrNoSuchEntity
View Source
var NewQuery = datastore.NewQuery

Functions

func NewClient

func NewClient(ctx context.Context, opts Options) (*datastore.Client, error)

Types

type AggregationQuery added in v0.0.6

type AggregationQuery = datastore.AggregationQuery

type AndFilter

type AndFilter = datastore.AndFilter

type Client added in v0.0.6

type Client = datastore.Client

type Entity

type Entity struct {
	Key        *Key            `json:"key"`
	Properties []Property      `json:"properties,omitempty"`
	Metadata   *EntityMetadata `json:"metadata,omitempty"`
}

func (*Entity) Load

func (e *Entity) Load(props []datastore.Property) error

func (*Entity) LoadKey

func (e *Entity) LoadKey(key *datastore.Key) error

func (*Entity) Save

func (e *Entity) Save() ([]datastore.Property, error)

type EntityFilter

type EntityFilter = datastore.EntityFilter

type EntityMetadata added in v0.0.6

type EntityMetadata struct {
	Version    int64
	CreateTime time.Time
	UpdateTime time.Time
}

type GeoPoint

type GeoPoint struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

type Key

type Key struct {
	Kind      string `json:"kind"`
	ID        int64  `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Parent    *Key   `json:"parent,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

func DecodeKey

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

func FromDatastoreKey added in v0.0.6

func FromDatastoreKey(src *datastore.Key) *Key

func (*Key) String added in v0.0.6

func (k *Key) String() string

func (*Key) ToDatastore

func (k *Key) ToDatastore() *datastore.Key

type KeyFormatter added in v0.0.6

type KeyFormatter struct {
	Format string
}

func (*KeyFormatter) FormatKey added in v0.0.6

func (k *KeyFormatter) FormatKey(key *Key) any

type Keys

type Keys []*Key

func (Keys) ToDatastore

func (k Keys) ToDatastore() []*datastore.Key

type LowLevelClient added in v0.0.6

type LowLevelClient struct {
	// contains filtered or unexported fields
}

func NewLowLevelClient added in v0.0.6

func NewLowLevelClient(client *datastore.Client) *LowLevelClient

func (*LowLevelClient) GetMetadata added in v0.0.6

func (c *LowLevelClient) GetMetadata(ctx context.Context, key *datastore.Key) (*EntityMetadata, error)

type MultiError

type MultiError = datastore.MultiError

type Mutation added in v0.0.6

type Mutation = datastore.Mutation

type Options

type Options struct {
	Emulator   string
	ProjectID  string
	DatabaseID string
}

type OrFilter

type OrFilter = datastore.OrFilter

type Property

type Property struct {
	Value
	Name    string `json:"name"`
	NoIndex bool   `json:"noIndex,omitempty"`
}

func NewPropertiesByProtoValueMap added in v0.0.6

func NewPropertiesByProtoValueMap(m map[string]any) []Property

func (*Property) UnmarshalJSON

func (p *Property) UnmarshalJSON(b []byte) error

type PropertyFilter

type PropertyFilter = datastore.PropertyFilter

type Query

type Query = datastore.Query

type Transaction added in v0.0.6

type Transaction = datastore.Transaction

type Type

type Type string
const (
	ArrayType     Type = "array"
	BlobType      Type = "blob"
	BoolType      Type = "bool"
	TimestampType Type = "timestamp"
	EntityType    Type = "entity"
	FloatType     Type = "float"
	GeoPointType  Type = "geo"
	IntType       Type = "int"
	KeyType       Type = "key"
	NullType      Type = "null"
	StringType    Type = "string"
)

type Value

type Value struct {
	Type  Type `json:"type"`
	Value any  `json:"value"`
}

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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