datastore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 AndFilter

type AndFilter = datastore.AndFilter

type Entity

type Entity struct {
	Key        *Key       `json:"key"`
	Properties []Property `json:"properties"`
}

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
var NopFilter EntityFilter = datastore.AndFilter{Filters: []datastore.EntityFilter{}}

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 (*Key) ToDatastore

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

type Keys

type Keys []*Key

func (Keys) ToDatastore

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

type MultiError

type MultiError = datastore.MultiError

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 (*Property) UnmarshalJSON

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

type PropertyFilter

type PropertyFilter = datastore.PropertyFilter

type Query

type Query = datastore.Query

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