firemodel

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestEnum_Strings = map[TestEnum]string{TestEnum_LEFT: "TestEnum_LEFT", TestEnum_RIGHT: "TestEnum_RIGHT", TestEnum_UP: "TestEnum_UP", TestEnum_DOWN: "TestEnum_DOWN"}
View Source
var TestEnum_Values = map[string]TestEnum{"TestEnum_LEFT": TestEnum_LEFT, "TestEnum_RIGHT": TestEnum_RIGHT, "TestEnum_UP": TestEnum_UP, "TestEnum_DOWN": TestEnum_DOWN}
View Source
var TestModelRegexNamedPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?users/(?P<user_id>[a-zA-Z0-9]+)/test_models/(?P<test_model_id>[a-zA-Z0-9]+)$")

TestModelRegexNamedPath is a named regex that can be use to filter out firestore events of TestModel

View Source
var TestModelRegexPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?users/([a-zA-Z0-9]+)/test_models/([a-zA-Z0-9]+)$")

TestModelRegexPath is a regex that can be use to filter out firestore events of TestModel

View Source
var TestTimestampsRegexNamedPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?timestamps/(?P<test_timestamps_id>[a-zA-Z0-9]+)$")

TestTimestampsRegexNamedPath is a named regex that can be use to filter out firestore events of TestTimestamps

View Source
var TestTimestampsRegexPath = regexp.MustCompile("^(?:projects/[^/]*/databases/[^/]*/documents/)?(?:/)?timestamps/([a-zA-Z0-9]+)$")

TestTimestampsRegexPath is a regex that can be use to filter out firestore events of TestTimestamps

Functions

func TestModelPath

func TestModelPath(userId string, testModelId string) string

TestModelPath returns the path to a particular TestModel in Firestore.

func TestModelStructToPath added in v0.0.19

func TestModelStructToPath(path *TestModelPathStruct) string

TestModelStructToPath is a function that turns a PathStruct of TestModel into a firestore path

func TestTimestampsPath

func TestTimestampsPath(testTimestampsId string) string

TestTimestampsPath returns the path to a particular TestTimestamps in Firestore.

func TestTimestampsStructToPath added in v0.0.19

func TestTimestampsStructToPath(path *TestTimestampsPathStruct) string

TestTimestampsStructToPath is a function that turns a PathStruct of TestTimestamps into a firestore path

Types

type Client added in v0.0.21

type Client struct {
	Client         *firestore.Client
	TestModel      *clientTestModel
	TestTimestamps *clientTestTimestamps
}

func NewClient added in v0.0.21

func NewClient(client *firestore.Client) *Client

type Test added in v0.0.10

type Test struct {
	// TODO: Add comment to Test.direction.
	Direction TestEnum `firestore:"direction,omitempty"`
}

TODO: Add comment to Test in firemodel schema.

type TestEnum added in v0.0.10

type TestEnum string

TODO: Add comment to TestEnum in firemodel schema.

const (
	// TODO: Add comment to TestEnum_LEFT in firemodel schema.
	TestEnum_LEFT TestEnum = "LEFT"
	// TODO: Add comment to TestEnum_RIGHT in firemodel schema.
	TestEnum_RIGHT TestEnum = "RIGHT"
	// TODO: Add comment to TestEnum_UP in firemodel schema.
	TestEnum_UP TestEnum = "UP"
	// TODO: Add comment to TestEnum_DOWN in firemodel schema.
	TestEnum_DOWN TestEnum = "DOWN"
)

func (TestEnum) String added in v0.0.16

func (e TestEnum) String() string

type TestModel

type TestModel struct {
	// The name.
	Name string `firestore:"name,omitempty"`
	// The age.
	Age int64 `firestore:"age"`
	// The number pi.
	Pi float64 `firestore:"pi"`
	// The birth date.
	Birthdate time.Time `firestore:"birthdate,omitempty"`
	// True if it is good.
	IsGood bool `firestore:"isGood"`
	// TODO: Add comment to TestModel.data.
	Data []byte `firestore:"data,omitempty"`
	// TODO: Add comment to TestModel.friend.
	Friend *firestore.DocumentRef `firestore:"friend,omitempty"`
	// TODO: Add comment to TestModel.location.
	Location *latlng.LatLng `firestore:"location,omitempty"`
	// TODO: Add comment to TestModel.colors.
	Colors []string `firestore:"colors,omitempty"`
	// TODO: Add comment to TestModel.numbers.
	Numbers []int64 `firestore:"numbers,omitempty"`
	// TODO: Add comment to TestModel.bools.
	Bools []bool `firestore:"bools,omitempty"`
	// TODO: Add comment to TestModel.doubles.
	Doubles []float64 `firestore:"doubles,omitempty"`
	// TODO: Add comment to TestModel.directions.
	Directions []TestEnum `firestore:"directions,omitempty"`
	// TODO: Add comment to TestModel.models.
	Models []*TestStruct `firestore:"models,omitempty"`
	// TODO: Add comment to TestModel.models_2.
	Models2 []*TestStruct `firestore:"models2,omitempty"`
	// TODO: Add comment to TestModel.refs.
	Refs []*firestore.DocumentRef `firestore:"refs,omitempty"`
	// TODO: Add comment to TestModel.model_refs.
	ModelRefs []*firestore.DocumentRef `firestore:"modelRefs,omitempty"`
	// TODO: Add comment to TestModel.meta.
	Meta map[string]interface{} `firestore:"meta,omitempty"`
	// TODO: Add comment to TestModel.meta_strs.
	MetaStrs map[string]string `firestore:"metaStrs,omitempty"`
	// TODO: Add comment to TestModel.direction.
	Direction TestEnum `firestore:"direction,omitempty"`
	// TODO: Add comment to TestModel.test_file.
	TestFile *runtime.File `firestore:"testFile,omitempty"`
	// TODO: Add comment to TestModel.url.
	Url runtime.URL `firestore:"url,omitempty"`
	// TODO: Add comment to TestModel.nested.
	Nested *TestStruct `firestore:"nested,omitempty"`

	// Creation timestamp.
	CreatedAt time.Time `firestore:"createdAt"`
	// Update timestamp.
	UpdatedAt time.Time `firestore:"updatedAt"`
}

A Test is a test model.

Firestore document location: /users/{user_id}/test_models/{test_model_id}

type TestModelPathStruct added in v0.0.19

type TestModelPathStruct struct {
	UserId      string
	TestModelId string
}

TestModelPathStruct is a struct that contains parts of a path of TestModel

func TestModelPathToStruct added in v0.0.19

func TestModelPathToStruct(path string) *TestModelPathStruct

TestModelPathToStruct is a function that turns a firestore path into a PathStruct of TestModel

type TestModelWrapper added in v0.0.19

type TestModelWrapper struct {
	Data    *TestModel
	Path    *TestModelPathStruct
	PathStr string
	// contains filtered or unexported fields
}

TestModelWrapper is a struct wrapper that contains a reference to the firemodel instance and the path

func TestModelFromSnapshot added in v0.0.21

func TestModelFromSnapshot(snapshot *firestore.DocumentSnapshot) (*TestModelWrapper, error)

TestModelFromSnapshot is a function that will create an instance of the model from a document snapshot

func (*TestModelWrapper) Set added in v0.0.21

func (m *TestModelWrapper) Set(ctx context.Context) error

func (*TestModelWrapper) SetTx added in v0.0.31

type TestStruct added in v0.0.5

type TestStruct struct {
	// TODO: Add comment to TestStruct.where.
	Where string `firestore:"where,omitempty"`
	// TODO: Add comment to TestStruct.how_much.
	HowMuch int64 `firestore:"howMuch"`
	// TODO: Add comment to TestStruct.some_enum.
	SomeEnum TestEnum `firestore:"someEnum,omitempty"`
}

TODO: Add comment to TestStruct in firemodel schema.

type TestTimestamps

type TestTimestamps struct {

	// Creation timestamp.
	CreatedAt time.Time `firestore:"createdAt"`
	// Update timestamp.
	UpdatedAt time.Time `firestore:"updatedAt"`
}

TODO: Add comment to TestTimestamps in firemodel schema.

Firestore document location: /timestamps/{test_timestamps_id}

type TestTimestampsPathStruct added in v0.0.19

type TestTimestampsPathStruct struct {
	TestTimestampsId string
}

TestTimestampsPathStruct is a struct that contains parts of a path of TestTimestamps

func TestTimestampsPathToStruct added in v0.0.19

func TestTimestampsPathToStruct(path string) *TestTimestampsPathStruct

TestTimestampsPathToStruct is a function that turns a firestore path into a PathStruct of TestTimestamps

type TestTimestampsWrapper added in v0.0.19

type TestTimestampsWrapper struct {
	Data    *TestTimestamps
	Path    *TestTimestampsPathStruct
	PathStr string
	// contains filtered or unexported fields
}

TestTimestampsWrapper is a struct wrapper that contains a reference to the firemodel instance and the path

func TestTimestampsFromSnapshot added in v0.0.21

func TestTimestampsFromSnapshot(snapshot *firestore.DocumentSnapshot) (*TestTimestampsWrapper, error)

TestTimestampsFromSnapshot is a function that will create an instance of the model from a document snapshot

func (*TestTimestampsWrapper) Set added in v0.0.21

func (*TestTimestampsWrapper) SetTx added in v0.0.31

Jump to

Keyboard shortcuts

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