state

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataPathRaw  = "Raw"
	DataPathID   = "Proto.Id"
	DataPathName = "Proto.Name"

	// Firestore collection names
	// CollectionCustomer - the collection to serialize stripe customer proto messages to
	CollectionCustomer CollectionName = "customers"
	// CollectionSubscription - the collection to serialize stripe subscription proto messages to
	CollectionSubscription CollectionName = "subscriptions"
	// CollectionWorkspace - the collection to serialize stripe subscription workspace proto messages to
	CollectionWorkspace CollectionName = "workspaces"
	// CollectionPlan - the collection to serialize stripe plans proto messages to
	CollectionPlan CollectionName = "plans"
	// CollectionProducts - the collection to serialize stripe product proto messages to
	CollectionProducts CollectionName = "products"
)
View Source
const TransformTag = "transform"

TransformTag is a custom struct tag for transforming field paths

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(doc *firestorepb.Document, msg protoreflect.ProtoMessage) error

func DocumentChildren added in v0.1.9

func DocumentChildren(txn *firestore.Transaction, snap *firestore.DocumentSnapshot) ([]*firestore.DocumentRef, error)

func GetDatabasePath

func GetDatabasePath() string

func RemoveSerialized

func RemoveSerialized(c firestore.Client, txn *firestore.Transaction, collection CollectionName, state protoreflect.ProtoMessage) error

func Serialize

Serialize returns the full path of the stored document or an error

func Transform

func Transform(in interface{}, out interface{}) error

Types

type CollectionName

type CollectionName string

type ProtoIdentifiable

type ProtoIdentifiable interface {
	protoreflect.ProtoMessage
	GetId() string
}

type ProtoNamed

type ProtoNamed interface {
	protoreflect.ProtoMessage
	GetName() string
}

type ProtoState added in v0.1.9

type ProtoState struct {
	Proto    interface{}              `json:"proto,inline"`
	Raw      interface{}              `json:"raw"`
	Parent   *firestore.DocumentRef   `json:"parent,omitempty"`
	Children []*firestore.DocumentRef `json:"children,omitempty"`
}

type ProtoSubscription

type ProtoSubscription interface {
	protoreflect.ProtoMessage
	GetSubscription() string
}

Jump to

Keyboard shortcuts

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