firestorm

package module
v0.0.0-...-f0aa4f0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 8 Imported by: 0

README

Firestorm

A Google Cloud Datastore Extension

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(v string) *string

String returns a pointer to string v.

func StringValue

func StringValue(v *string) string

StringValue returns the string from a string pointer v.

Types

type Completion

type Completion struct {
	Key    *datastore.Key
	Client *datastore.Client
}

Completion completes the given key

func CompletionOf

func CompletionOf(client *datastore.Client, key *datastore.Key) *Completion

CompletionOf returns the completion

func (*Completion) LoadKey

func (k *Completion) LoadKey(ctx context.Context, entity datastore.KeyLoader) error

LoadKey completes a given key

type Index

type Index struct {
	Name string
	// should be string
	Properties [][]int
}

Index represents the index

func (*Index) Hash

func (index *Index) Hash(v reflect.Value) (uint64, error)

Hash calculates the index value

type IndexKey

type IndexKey struct {
	Key  *datastore.Key `datastore:"__key__"`
	Hash uint64         `datastore:"-"`
}

IndexKey represents an index key

type IndexMapper

type IndexMapper struct {
	Mutex *sync.Mutex
	Cache map[reflect.Type]*IndexTree
}

IndexMapper represents the indexer

func (*IndexMapper) Tree

func (m *IndexMapper) Tree(t reflect.Type) *IndexTree

Tree returns the index tree

type IndexTree

type IndexTree []*Index

IndexTree represents the index

func (*IndexTree) Keys

func (t *IndexTree) Keys(key *datastore.Key, input reflect.Value) ([]*IndexKey, error)

Keys returns the keys

type Indexer

type Indexer interface {
	Index(tx *datastore.Transaction) error
}

Indexer represents an entity indexer

func NewDeleteIndexer

func NewDeleteIndexer(key *datastore.Key, input interface{}) Indexer

NewDeleteIndexer represents an upsert check

func NewInsertIndexer

func NewInsertIndexer(key *datastore.Key, input interface{}) Indexer

NewInsertIndexer represents an insert indexer

func NewUpdateIndexer

func NewUpdateIndexer(key *datastore.Key, input interface{}) Indexer

NewUpdateIndexer represents an update indexer

func NewUpsertIndexer

func NewUpsertIndexer(key *datastore.Key, input interface{}) Indexer

NewUpsertIndexer represents an update indexer

type IndexerFunc

type IndexerFunc func(tx *datastore.Transaction) error

IndexerFunc represents a checker func

func (IndexerFunc) Index

func (fn IndexerFunc) Index(tx *datastore.Transaction) error

Index indexes the record

type Partial

type Partial struct {
	Properties []string
	Entity     datastore.KeyLoader
}

Partial represents a partial entity

func (*Partial) Load

func (p *Partial) Load(props []datastore.Property) error

Load loads all properties that are not matching the partial modified

func (*Partial) LoadKey

func (p *Partial) LoadKey(key *datastore.Key) error

LoadKey loads the key

func (*Partial) Save

func (p *Partial) Save() ([]datastore.Property, error)

Save saves the partial

type Query

type Query struct {
	Ancestor *datastore.Key
	Cursor   string
	Offset   int
	Limit    int
}

Query is the query condition

func (*Query) Build

func (w *Query) Build(query *datastore.Query) (*datastore.Query, error)

Build builds the query

Jump to

Keyboard shortcuts

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