Documentation ¶
Index ¶
- Variables
- func TestModelPath(userId string, testModelId string) string
- func TestModelStructToPath(path *TestModelPathStruct) string
- func TestTimestampsPath(testTimestampsId string) string
- func TestTimestampsStructToPath(path *TestTimestampsPathStruct) string
- type Client
- type Test
- type TestEnum
- type TestModel
- type TestModelPathStruct
- type TestModelWrapper
- type TestStruct
- type TestTimestamps
- type TestTimestampsPathStruct
- type TestTimestampsWrapper
Constants ¶
This section is empty.
Variables ¶
var TestEnum_Strings = map[TestEnum]string{TestEnum_LEFT: "TestEnum_LEFT", TestEnum_RIGHT: "TestEnum_RIGHT", TestEnum_UP: "TestEnum_UP", TestEnum_DOWN: "TestEnum_DOWN"}
var TestEnum_Values = map[string]TestEnum{"TestEnum_LEFT": TestEnum_LEFT, "TestEnum_RIGHT": TestEnum_RIGHT, "TestEnum_UP": TestEnum_UP, "TestEnum_DOWN": TestEnum_DOWN}
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
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
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
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 ¶
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 ¶
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 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" )
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
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
func (m *TestModelWrapper) SetTx(ctx context.Context, tx *firestore.Transaction) error
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 (m *TestTimestampsWrapper) Set(ctx context.Context) error
func (*TestTimestampsWrapper) SetTx ¶ added in v0.0.31
func (m *TestTimestampsWrapper) SetTx(ctx context.Context, tx *firestore.Transaction) error