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 {
Direction TestEnum `firestore:"direction,omitempty"`
}
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"` Data []byte `firestore:"data,omitempty"` Friend *firestore.DocumentRef `firestore:"friend,omitempty"` Location *latlng.LatLng `firestore:"location,omitempty"` Colors []string `firestore:"colors,omitempty"` Numbers []int64 `firestore:"numbers,omitempty"` Bools []bool `firestore:"bools,omitempty"` Doubles []float64 `firestore:"doubles,omitempty"` Directions []TestEnum `firestore:"directions,omitempty"` Models []*TestStruct `firestore:"models,omitempty"` Models2 []*TestStruct `firestore:"models2,omitempty"` Refs []*firestore.DocumentRef `firestore:"refs,omitempty"` ModelRefs []*firestore.DocumentRef `firestore:"modelRefs,omitempty"` Meta map[string]interface{} `firestore:"meta,omitempty"` MetaStrs map[string]string `firestore:"metaStrs,omitempty"` Direction TestEnum `firestore:"direction,omitempty"` TestFile *runtime.File `firestore:"testFile,omitempty"` Url runtime.URL `firestore:"url,omitempty"` 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 TestTimestamps ¶
type TestTimestamps struct { // Creation timestamp. CreatedAt time.Time `firestore:"createdAt"` // Update timestamp. UpdatedAt time.Time `firestore:"updatedAt"` }
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