Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchEntity = errors.New("firestore: no such entity")

Functions

This section is empty.

Types

type Database

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

func Open

func Open(googleCloudProject string) (*Database, error)

func (*Database) Entity

func (db *Database) Entity(gold Model) *EntityKV

func (*Database) ProtoKV

func (db *Database) ProtoKV(collection, key string) *ProtoKV

func (*Database) StringKV

func (db *Database) StringKV(collection, key string) *StringKV

type EntityKV

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

func (*EntityKV) Delete

func (kv *EntityKV) Delete(ctx context.Context, model Model) error

func (*EntityKV) Get

func (kv *EntityKV) Get(ctx context.Context, model Model) error

func (*EntityKV) Put

func (kv *EntityKV) Put(ctx context.Context, model Model) error

func (*EntityKV) Query

func (kv *EntityKV) Query() Query

type Model

type Model interface {
	Collection() string
	Key() string
}

type ProtoKV

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

func (*ProtoKV) Delete

func (kv *ProtoKV) Delete(ctx context.Context) error

func (*ProtoKV) Get

func (kv *ProtoKV) Get(ctx context.Context, model proto.Message) error

func (*ProtoKV) GetBytes

func (kv *ProtoKV) GetBytes(ctx context.Context) ([]byte, error)

func (*ProtoKV) Put

func (kv *ProtoKV) Put(ctx context.Context, model proto.Message) error

type Query

type Query = firestore.Query

type StringKV

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

func (*StringKV) Get

func (kv *StringKV) Get(ctx context.Context, content *string) error

func (*StringKV) Put

func (kv *StringKV) Put(ctx context.Context, content string) error