Documentation ¶
Overview ¶
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Code generated by volcago. DO NOT EDIT. generated version: (devel)
Index ¶
- Constants
- Variables
- func IsSlice(v interface{}) bool
- func SetLastThreeToZero(t time.Time) time.Time
- type Cursor
- type DeleteMode
- type DeleteOption
- type Embedded
- type Filter
- type FilterType
- type GetOption
- type History
- type HistoryRepository
- type HistoryRepositoryMiddleware
- type HistorySearchParam
- type HistoryUpdateParam
- type Inner
- type Lock
- type Meta
- type MultiError
- type MultiErrors
- type Nested
- type OpType
- type PagingResult
- type Query
- type QueryBuilder
- func (qb *QueryBuilder) ArrayContains(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) ArrayContainsAny(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) Asc(path string) *QueryBuilder
- func (qb *QueryBuilder) Check() error
- func (qb *QueryBuilder) Desc(path string) *QueryBuilder
- func (qb *QueryBuilder) EndAt(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) EndBefore(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) Equal(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) GreaterThan(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) GreaterThanOrEqual(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) In(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) LessThan(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) LessThanOrEqual(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) Limit(limit int) *QueryBuilder
- func (qb *QueryBuilder) NotEqual(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) NotIn(path string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) Query() *firestore.Query
- func (qb *QueryBuilder) StartAfter(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) StartAt(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
- type QueryChainer
- func (qc *QueryChainer) ArrayContains(v interface{}) *QueryChainer
- func (qc *QueryChainer) ArrayContainsAny(v interface{}) *QueryChainer
- func (qc *QueryChainer) Asc() *QueryChainer
- func (qc *QueryChainer) BuildCursorQuery(q firestore.Query) firestore.Query
- func (qc *QueryChainer) Desc() *QueryChainer
- func (qc *QueryChainer) EndAt(v ...interface{}) *QueryChainer
- func (qc *QueryChainer) EndBefore(v ...interface{}) *QueryChainer
- func (qc *QueryChainer) Equal(v interface{}) *QueryChainer
- func (qc *QueryChainer) Error() error
- func (qc *QueryChainer) Filters(v interface{}, filterTypes ...FilterType) *QueryChainer
- func (qc *QueryChainer) GreaterThan(v interface{}) *QueryChainer
- func (qc *QueryChainer) GreaterThanOrEqual(v interface{}) *QueryChainer
- func (qc *QueryChainer) In(v interface{}) *QueryChainer
- func (qc *QueryChainer) LessThan(v interface{}) *QueryChainer
- func (qc *QueryChainer) LessThanOrEqual(v interface{}) *QueryChainer
- func (qc *QueryChainer) NotEqual(v interface{}) *QueryChainer
- func (qc *QueryChainer) NotIn(v interface{}) *QueryChainer
- func (qc *QueryChainer) StartAfter(v ...interface{}) *QueryChainer
- func (qc *QueryChainer) StartAt(v ...interface{}) *QueryChainer
- type Task
- type TaskKind
- type TaskRepository
- type TaskRepositoryMiddleware
- type TaskSearchParam
- type TaskUpdateParam
- type Unique
- type UniqueMiddlewareKey
- type UniqueRepositoryMiddleware
- Bugs
Constants ¶
const ( HistoryIndexLabelIsSubCollectionPrefix = "i1" // prefix-match of IsSubCollection HistoryIndexLabelIsSubCollectionSuffix = "i2" // suffix-match of IsSubCollection HistoryIndexLabelIsSubCollectionLike = "i3" // like-match of IsSubCollection HistoryIndexLabelIsSubCollectionEqual = "i4" // perfect-match of IsSubCollection )
const ( TaskIndexLabelDescEqual = "d4" // perfect-match of Desc TaskIndexLabelDescLike = "d3" // like-match of Desc TaskIndexLabelDescPrefix = "d1" // prefix-match of Desc TaskIndexLabelDescSuffix = "d2" // suffix-match of Desc TaskIndexLabelCreatedPrefix = "c1" // prefix-match of Created TaskIndexLabelCreatedSuffix = "c2" // suffix-match of Created TaskIndexLabelCreatedLike = "c3" // like-match of Created TaskIndexLabelCreatedEqual = "c4" // perfect-match of Created TaskIndexLabelReservedDatePrefix = "r1" // prefix-match of ReservedDate TaskIndexLabelReservedDateSuffix = "r2" // suffix-match of ReservedDate TaskIndexLabelReservedDateLike = "r3" // like-match of ReservedDate TaskIndexLabelReservedDateEqual = "r4" // perfect-match of ReservedDate TaskIndexLabelDonePrefix = "d5" // prefix-match of Done TaskIndexLabelDoneSuffix = "d6" // suffix-match of Done TaskIndexLabelDoneLike = "d7" // like-match of Done TaskIndexLabelDoneEqual = "d8" // perfect-match of Done TaskIndexLabelDone2Prefix = "d9" // prefix-match of Done2 TaskIndexLabelDone2Suffix = "do1" // suffix-match of Done2 TaskIndexLabelDone2Like = "do2" // like-match of Done2 TaskIndexLabelDone2Equal = "do3" // perfect-match of Done2 TaskIndexLabelCountPrefix = "c5" // prefix-match of Count TaskIndexLabelCountSuffix = "c6" // suffix-match of Count TaskIndexLabelCountLike = "c7" // like-match of Count TaskIndexLabelCountEqual = "c8" // perfect-match of Count TaskIndexLabelCount64Prefix = "c9" // prefix-match of Count64 TaskIndexLabelCount64Suffix = "co1" // suffix-match of Count64 TaskIndexLabelCount64Like = "co2" // like-match of Count64 TaskIndexLabelCount64Equal = "co3" // perfect-match of Count64 TaskIndexLabelNameListPrefix = "n1" // prefix-match of NameList TaskIndexLabelNameListSuffix = "n2" // suffix-match of NameList TaskIndexLabelNameListLike = "n3" // like-match of NameList TaskIndexLabelNameListEqual = "n4" // perfect-match of NameList TaskIndexLabelProportionPrefix = "p1" // prefix-match of Proportion TaskIndexLabelProportionSuffix = "p2" // suffix-match of Proportion TaskIndexLabelProportionLike = "p3" // like-match of Proportion TaskIndexLabelProportionEqual = "p4" // perfect-match of Proportion TaskIndexLabelTaskKindEqual = "t4" // perfect-match of TaskKind TaskIndexLabelTaskKindLike = "t3" // like-match of TaskKind TaskIndexLabelTaskKindPrefix = "t1" // prefix-match of TaskKind TaskIndexLabelTaskKindSuffix = "t2" // suffix-match of TaskKind TaskIndexLabelFlagPrefix = "f1" // prefix-match of Flag TaskIndexLabelFlagSuffix = "f2" // suffix-match of Flag TaskIndexLabelFlagLike = "f3" // like-match of Flag TaskIndexLabelFlagEqual = "f4" // perfect-match of Flag TaskIndexLabelInner_AEqual = "i4" // perfect-match of Inner.A TaskIndexLabelInner_ALike = "i3" // like-match of Inner.A TaskIndexLabelInner_APrefix = "i1" // prefix-match of Inner.A TaskIndexLabelInner_ASuffix = "i2" // suffix-match of Inner.A TaskIndexLabelInner_CodeEqual = "i8" // perfect-match of Inner.Code TaskIndexLabelInner_CodeLike = "i7" // like-match of Inner.Code TaskIndexLabelInner_CodePrefix = "i5" // prefix-match of Inner.Code TaskIndexLabelInner_CodeSuffix = "i6" // suffix-match of Inner.Code TaskIndexLabelInner_EmailEqual = "in3" // perfect-match of Inner.Email TaskIndexLabelInner_EmailLike = "in2" // like-match of Inner.Email TaskIndexLabelInner_EmailPrefix = "i9" // prefix-match of Inner.Email TaskIndexLabelInner_EmailSuffix = "in1" // suffix-match of Inner.Email TaskIndexLabelInnerRef_AEqual = "in7" // perfect-match of InnerRef.A TaskIndexLabelInnerRef_ALike = "in6" // like-match of InnerRef.A TaskIndexLabelInnerRef_APrefix = "in4" // prefix-match of InnerRef.A TaskIndexLabelInnerRef_ASuffix = "in5" // suffix-match of InnerRef.A TaskIndexLabelInnerRef_CodeEqual = "inn2" // perfect-match of InnerRef.Code TaskIndexLabelInnerRef_CodeLike = "inn1" // like-match of InnerRef.Code TaskIndexLabelInnerRef_CodePrefix = "in8" // prefix-match of InnerRef.Code TaskIndexLabelInnerRef_CodeSuffix = "in9" // suffix-match of InnerRef.Code TaskIndexLabelInnerRef_EmailEqual = "inn6" // perfect-match of InnerRef.Email TaskIndexLabelInnerRef_EmailLike = "inn5" // like-match of InnerRef.Email TaskIndexLabelInnerRef_EmailPrefix = "inn3" // prefix-match of InnerRef.Email TaskIndexLabelInnerRef_EmailSuffix = "inn4" // suffix-match of InnerRef.Email TaskIndexLabelInnerMapPrefix = "inn7" // prefix-match of InnerMap TaskIndexLabelInnerMapSuffix = "inn8" // suffix-match of InnerMap TaskIndexLabelInnerMapLike = "inn9" // like-match of InnerMap TaskIndexLabelInnerMapEqual = "inne1" // perfect-match of InnerMap )
Variables ¶
var ( ErrAlreadyExists = xerrors.New("already exists") ErrAlreadyDeleted = xerrors.New("already been deleted") ErrNotFound = xerrors.New("not found") ErrLogicallyDeletedData = xerrors.New("logically deleted data") ErrUniqueConstraint = xerrors.New("unique constraint error") ErrNotAvailableCG = xerrors.New("not available in collection groups") ErrVersionConflict = xerrors.New("version conflict") )
Functions ¶
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor - query cursor
type DeleteMode ¶
type DeleteMode int
DeleteMode - delete mode
const ( DeleteModeSoft DeleteMode = iota + 1 // logical delete mode DeleteModeHard // physical delete mode )
type DeleteOption ¶
type DeleteOption struct {
Mode DeleteMode
}
DeleteOption - option to delete logically or physically default: physical deletion use `DeleteModeSoft` or `DeleteModeHard
type Filter ¶
type Filter struct { FilterTypes []FilterType Value interface{} }
Filter - filters of extra indexer
type FilterType ¶
type FilterType = int
FilterType - extra indexes filters type
const ( FilterTypeAdd FilterType = 1 << iota FilterTypeAddPrefix FilterTypeAddSuffix FilterTypeAddBiunigrams FilterTypeAddSomething )
type GetOption ¶
type GetOption struct {
IncludeSoftDeleted bool
}
GetOption - option to include logical deletion data
type History ¶
type History struct { ID string `firestore:"-" firestore_key:"auto"` IsSubCollection bool `` IsBool bool `firestore:"-"` }
History - Task sub-collection
type HistoryRepository ¶
type HistoryRepository interface { // Single Get(ctx context.Context, id string, opts ...GetOption) (*History, error) GetWithDoc(ctx context.Context, doc *firestore.DocumentRef, opts ...GetOption) (*History, error) Insert(ctx context.Context, subject *History) (_ string, err error) Update(ctx context.Context, subject *History) (err error) StrictUpdate(ctx context.Context, id string, param *HistoryUpdateParam, opts ...firestore.Precondition) error Delete(ctx context.Context, subject *History, opts ...DeleteOption) (err error) DeleteByID(ctx context.Context, id string, opts ...DeleteOption) (err error) // Multiple GetMulti(ctx context.Context, ids []string, opts ...GetOption) ([]*History, error) InsertMulti(ctx context.Context, subjects []*History) (_ []string, er error) UpdateMulti(ctx context.Context, subjects []*History) (er error) DeleteMulti(ctx context.Context, subjects []*History, opts ...DeleteOption) (er error) DeleteMultiByIDs(ctx context.Context, ids []string, opts ...DeleteOption) (er error) // Single(Transaction) GetWithTx(tx *firestore.Transaction, id string, opts ...GetOption) (*History, error) GetWithDocWithTx(tx *firestore.Transaction, doc *firestore.DocumentRef, opts ...GetOption) (*History, error) InsertWithTx(ctx context.Context, tx *firestore.Transaction, subject *History) (_ string, err error) UpdateWithTx(ctx context.Context, tx *firestore.Transaction, subject *History) (err error) StrictUpdateWithTx(tx *firestore.Transaction, id string, param *HistoryUpdateParam, opts ...firestore.Precondition) error DeleteWithTx(ctx context.Context, tx *firestore.Transaction, subject *History, opts ...DeleteOption) (err error) DeleteByIDWithTx(ctx context.Context, tx *firestore.Transaction, id string, opts ...DeleteOption) (err error) // Multiple(Transaction) GetMultiWithTx(tx *firestore.Transaction, ids []string, opts ...GetOption) ([]*History, error) InsertMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*History) (_ []string, er error) UpdateMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*History) (er error) DeleteMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*History, opts ...DeleteOption) (er error) DeleteMultiByIDsWithTx(ctx context.Context, tx *firestore.Transaction, ids []string, opts ...DeleteOption) (er error) // Search Search(ctx context.Context, param *HistorySearchParam, q *firestore.Query) ([]*History, error) SearchWithTx(tx *firestore.Transaction, param *HistorySearchParam, q *firestore.Query) ([]*History, error) SearchByParam(ctx context.Context, param *HistorySearchParam) ([]*History, *PagingResult, error) SearchByParamWithTx(tx *firestore.Transaction, param *HistorySearchParam) ([]*History, *PagingResult, error) // misc GetCollection() *firestore.CollectionRef GetCollectionName() string GetDocRef(id string) *firestore.DocumentRef RunInTransaction() func(ctx context.Context, f func(context.Context, *firestore.Transaction) error, opts ...firestore.TransactionOption) (err error) SetParentDoc(doc *firestore.DocumentRef) NewRepositoryByParent(doc *firestore.DocumentRef) HistoryRepository Free() }
HistoryRepository - Repository of History
func NewHistoryCollectionGroupRepository ¶
func NewHistoryCollectionGroupRepository(firestoreClient *firestore.Client) HistoryRepository
NewHistoryCollectionGroupRepository - constructor
func NewHistoryRepository ¶
func NewHistoryRepository(firestoreClient *firestore.Client, parentDocument *firestore.DocumentRef, middleware ...HistoryRepositoryMiddleware) HistoryRepository
NewHistoryRepository - constructor
type HistoryRepositoryMiddleware ¶
type HistoryRepositoryMiddleware interface { BeforeInsert(ctx context.Context, subject *History) (bool, error) BeforeUpdate(ctx context.Context, old, subject *History) (bool, error) BeforeDelete(ctx context.Context, subject *History, opts ...DeleteOption) (bool, error) BeforeDeleteByID(ctx context.Context, ids []string, opts ...DeleteOption) (bool, error) }
HistoryRepositoryMiddleware - middleware of HistoryRepository
type HistorySearchParam ¶
type HistorySearchParam struct { ID *QueryChainer IsSubCollection *QueryChainer CursorKey string CursorLimit int }
HistorySearchParam - params for search
type HistoryUpdateParam ¶
type HistoryUpdateParam struct {
IsSubCollection interface{}
}
HistoryUpdateParam - params for strict updates
type Lock ¶
type Lock struct { ID string `firestore:"-" firestore_key:"auto"` Text string `firestore:"text" unique:""` Email string `unique:""` Flag map[string]float64 `firestore:"flag"` Interface interface{} `firestore:"interface"` MapInterface map[string]interface{} `firestore:"map_interface"` Nested Nested `firestore:"nested"` NestedPtr *Nested `firestore:"nested_ptr"` SliceString []string `firestore:"slice_string"` SliceNested []*Nested `firestore:"slice_nested"` Meta }
Lock - with automatic id generation
type Meta ¶
type Meta struct { CreatedAt time.Time `firestore:"createdAt"` CreatedBy string `firestore:"createdBy"` UpdatedAt time.Time `firestore:"updatedAt"` UpdatedBy string `firestore:"updatedBy"` DeletedAt *time.Time `firestore:"deletedAt"` DeletedBy string `firestore:"deletedBy"` Version int `firestore:"version"` }
Meta - meta information for optimistic exclusive lock
type MultiError ¶
MultiError - multi error interface
func NewMultiError ¶
func NewMultiError(index int, err error) MultiError
NewMultiError - constructor
type Nested ¶ added in v1.1.3
type Nested struct {
Name string `firestore:"name"`
}
Nested - nested struct
type OpType ¶
type OpType = string
OpType - operator type
const ( OpTypeEqual OpType = "==" OpTypeNotEqual OpType = "!=" OpTypeLessThan OpType = "<" OpTypeLessThanOrEqual OpType = "<=" OpTypeGreaterThan OpType = ">" OpTypeGreaterThanOrEqual OpType = ">=" OpTypeIn OpType = "in" OpTypeNotIn OpType = "not-in" OpTypeArrayContains OpType = "array-contains" OpTypeArrayContainsAny OpType = "array-contains-any" )
type PagingResult ¶ added in v1.3.0
PagingResult - paging result
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder - query builder
func NewQueryBuilder ¶
func NewQueryBuilder(collection *firestore.CollectionRef) *QueryBuilder
NewQueryBuilder - constructor
func (*QueryBuilder) ArrayContains ¶
func (qb *QueryBuilder) ArrayContains(path string, value interface{}) *QueryBuilder
ArrayContains - array filter ( `array-contains` )
func (*QueryBuilder) ArrayContainsAny ¶
func (qb *QueryBuilder) ArrayContainsAny(path string, value interface{}) *QueryBuilder
ArrayContainsAny - array filter ( `array-contains-any` )
func (*QueryBuilder) EndAt ¶
func (qb *QueryBuilder) EndAt(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
EndAt - end at
func (*QueryBuilder) EndBefore ¶
func (qb *QueryBuilder) EndBefore(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
EndBefore - end before
func (*QueryBuilder) Equal ¶
func (qb *QueryBuilder) Equal(path string, value interface{}) *QueryBuilder
Equal - equality filter ( `==` )
func (*QueryBuilder) GreaterThan ¶
func (qb *QueryBuilder) GreaterThan(path string, value interface{}) *QueryBuilder
GreaterThan - range filter ( `>` )
func (*QueryBuilder) GreaterThanOrEqual ¶
func (qb *QueryBuilder) GreaterThanOrEqual(path string, value interface{}) *QueryBuilder
GreaterThanOrEqual - range filter ( `>=` )
func (*QueryBuilder) In ¶
func (qb *QueryBuilder) In(path string, value interface{}) *QueryBuilder
In - array filter ( `in` )
func (*QueryBuilder) LessThan ¶
func (qb *QueryBuilder) LessThan(path string, value interface{}) *QueryBuilder
LessThan - range filter ( `<` )
func (*QueryBuilder) LessThanOrEqual ¶
func (qb *QueryBuilder) LessThanOrEqual(path string, value interface{}) *QueryBuilder
LessThanOrEqual - range filter ( `<=` )
func (*QueryBuilder) NotEqual ¶
func (qb *QueryBuilder) NotEqual(path string, value interface{}) *QueryBuilder
NotEqual - inequality filter ( `!=` )
func (*QueryBuilder) NotIn ¶
func (qb *QueryBuilder) NotIn(path string, value interface{}) *QueryBuilder
NotIn - array filter ( `not-in` )
func (*QueryBuilder) Query ¶
func (qb *QueryBuilder) Query() *firestore.Query
Query - return firestore.Query
func (*QueryBuilder) StartAfter ¶
func (qb *QueryBuilder) StartAfter(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
StartAfter - start after
func (*QueryBuilder) StartAt ¶
func (qb *QueryBuilder) StartAt(docSnapshotOrFieldValues ...interface{}) *QueryBuilder
StartAt - start at
type QueryChainer ¶
type QueryChainer struct { QueryGroup []*Query OrderByDirection firestore.Direction Filter Filter // contains filtered or unexported fields }
QueryChainer - query chainer
func (*QueryChainer) ArrayContains ¶
func (qc *QueryChainer) ArrayContains(v interface{}) *QueryChainer
ArrayContains - `array-contains`
func (*QueryChainer) ArrayContainsAny ¶
func (qc *QueryChainer) ArrayContainsAny(v interface{}) *QueryChainer
ArrayContainsAny - `array-contains-any`
func (*QueryChainer) BuildCursorQuery ¶
func (qc *QueryChainer) BuildCursorQuery(q firestore.Query) firestore.Query
BuildCursor - build query for cursor
func (*QueryChainer) EndAt ¶
func (qc *QueryChainer) EndAt(v ...interface{}) *QueryChainer
EndAt - end at
func (*QueryChainer) EndBefore ¶
func (qc *QueryChainer) EndBefore(v ...interface{}) *QueryChainer
EndBefore - end before
func (*QueryChainer) Equal ¶
func (qc *QueryChainer) Equal(v interface{}) *QueryChainer
Equal - `==`
func (*QueryChainer) Filters ¶
func (qc *QueryChainer) Filters(v interface{}, filterTypes ...FilterType) *QueryChainer
Filters - using `xim`
func (*QueryChainer) GreaterThan ¶
func (qc *QueryChainer) GreaterThan(v interface{}) *QueryChainer
GreaterThan - `>`
func (*QueryChainer) GreaterThanOrEqual ¶
func (qc *QueryChainer) GreaterThanOrEqual(v interface{}) *QueryChainer
GreaterThanOrEqual - `>=`
func (*QueryChainer) LessThan ¶
func (qc *QueryChainer) LessThan(v interface{}) *QueryChainer
LessThan - `<`
func (*QueryChainer) LessThanOrEqual ¶
func (qc *QueryChainer) LessThanOrEqual(v interface{}) *QueryChainer
LessThanOrEqual - `<=`
func (*QueryChainer) NotEqual ¶
func (qc *QueryChainer) NotEqual(v interface{}) *QueryChainer
NotEqual - `!=`
func (*QueryChainer) NotIn ¶
func (qc *QueryChainer) NotIn(v interface{}) *QueryChainer
NotIn - `not-in`
func (*QueryChainer) StartAfter ¶
func (qc *QueryChainer) StartAfter(v ...interface{}) *QueryChainer
StartAt - start after
func (*QueryChainer) StartAt ¶
func (qc *QueryChainer) StartAt(v ...interface{}) *QueryChainer
StartAt - start at
type Task ¶
type Task struct { Embedded Created time.Time `firestore:"created"` ReservedDate *time.Time `firestore:"reservedDate"` Done bool `firestore:"done"` Done2 bool `firestore:"done2"` Count int `firestore:"count"` Count64 int64 `firestore:"count64"` NameList []string `firestore:"nameList"` Proportion float64 `firestore:"proportion" indexer:"e"` TaskKind TaskKind `firestore:"taskKind" indexer:"e"` Flag map[string]float64 `firestore:"flag"` Indexes map[string]bool `` Inner Inner `firestore:"inner"` InnerRef *Inner `firestore:"innerRef"` InnerMap map[string]Inner `firestore:"innerMap"` }
Task - with automatic id generation
type TaskRepository ¶
type TaskRepository interface { // Single Get(ctx context.Context, id string, opts ...GetOption) (*Task, error) GetWithDoc(ctx context.Context, doc *firestore.DocumentRef, opts ...GetOption) (*Task, error) Insert(ctx context.Context, subject *Task) (_ string, err error) Update(ctx context.Context, subject *Task) (err error) StrictUpdate(ctx context.Context, id string, param *TaskUpdateParam, opts ...firestore.Precondition) error Delete(ctx context.Context, subject *Task, opts ...DeleteOption) (err error) DeleteByID(ctx context.Context, id string, opts ...DeleteOption) (err error) // Multiple GetMulti(ctx context.Context, ids []string, opts ...GetOption) ([]*Task, error) InsertMulti(ctx context.Context, subjects []*Task) (_ []string, er error) UpdateMulti(ctx context.Context, subjects []*Task) (er error) DeleteMulti(ctx context.Context, subjects []*Task, opts ...DeleteOption) (er error) DeleteMultiByIDs(ctx context.Context, ids []string, opts ...DeleteOption) (er error) // Single(Transaction) GetWithTx(tx *firestore.Transaction, id string, opts ...GetOption) (*Task, error) GetWithDocWithTx(tx *firestore.Transaction, doc *firestore.DocumentRef, opts ...GetOption) (*Task, error) InsertWithTx(ctx context.Context, tx *firestore.Transaction, subject *Task) (_ string, err error) UpdateWithTx(ctx context.Context, tx *firestore.Transaction, subject *Task) (err error) StrictUpdateWithTx(tx *firestore.Transaction, id string, param *TaskUpdateParam, opts ...firestore.Precondition) error DeleteWithTx(ctx context.Context, tx *firestore.Transaction, subject *Task, opts ...DeleteOption) (err error) DeleteByIDWithTx(ctx context.Context, tx *firestore.Transaction, id string, opts ...DeleteOption) (err error) // Multiple(Transaction) GetMultiWithTx(tx *firestore.Transaction, ids []string, opts ...GetOption) ([]*Task, error) InsertMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*Task) (_ []string, er error) UpdateMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*Task) (er error) DeleteMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*Task, opts ...DeleteOption) (er error) DeleteMultiByIDsWithTx(ctx context.Context, tx *firestore.Transaction, ids []string, opts ...DeleteOption) (er error) // Search Search(ctx context.Context, param *TaskSearchParam, q *firestore.Query) ([]*Task, error) SearchWithTx(tx *firestore.Transaction, param *TaskSearchParam, q *firestore.Query) ([]*Task, error) SearchByParam(ctx context.Context, param *TaskSearchParam) ([]*Task, *PagingResult, error) SearchByParamWithTx(tx *firestore.Transaction, param *TaskSearchParam) ([]*Task, *PagingResult, error) // misc GetCollection() *firestore.CollectionRef GetCollectionName() string GetDocRef(id string) *firestore.DocumentRef RunInTransaction() func(ctx context.Context, f func(context.Context, *firestore.Transaction) error, opts ...firestore.TransactionOption) (err error) // get by unique field GetByInnerCode(ctx context.Context, innerCode string) (*Task, error) GetByInnerCodeWithTx(tx *firestore.Transaction, innerCode string) (*Task, error) GetByInnerEmail(ctx context.Context, innerEmail string) (*Task, error) GetByInnerEmailWithTx(tx *firestore.Transaction, innerEmail string) (*Task, error) GetByInnerRefCode(ctx context.Context, innerRefCode string) (*Task, error) GetByInnerRefCodeWithTx(tx *firestore.Transaction, innerRefCode string) (*Task, error) GetByInnerRefEmail(ctx context.Context, innerRefEmail string) (*Task, error) GetByInnerRefEmailWithTx(tx *firestore.Transaction, innerRefEmail string) (*Task, error) }
TaskRepository - Repository of Task
func NewTaskRepository ¶
func NewTaskRepository(firestoreClient *firestore.Client, middleware ...TaskRepositoryMiddleware) TaskRepository
NewTaskRepository - constructor
type TaskRepositoryMiddleware ¶
type TaskRepositoryMiddleware interface { BeforeInsert(ctx context.Context, subject *Task) (bool, error) BeforeUpdate(ctx context.Context, old, subject *Task) (bool, error) BeforeDelete(ctx context.Context, subject *Task, opts ...DeleteOption) (bool, error) BeforeDeleteByID(ctx context.Context, ids []string, opts ...DeleteOption) (bool, error) }
TaskRepositoryMiddleware - middleware of TaskRepository
type TaskSearchParam ¶
type TaskSearchParam struct { ID *QueryChainer Desc *QueryChainer Created *QueryChainer ReservedDate *QueryChainer Done *QueryChainer Done2 *QueryChainer Count *QueryChainer Count64 *QueryChainer NameList *QueryChainer Proportion *QueryChainer TaskKind *QueryChainer Flag *QueryChainer Inner struct { A *QueryChainer Code *QueryChainer Email *QueryChainer } InnerRef struct { A *QueryChainer Code *QueryChainer Email *QueryChainer } InnerMap *QueryChainer CursorKey string CursorLimit int }
TaskSearchParam - params for search
type TaskUpdateParam ¶
type TaskUpdateParam struct { Desc interface{} Created interface{} ReservedDate interface{} Done interface{} Done2 interface{} Count interface{} Count64 interface{} NameList interface{} Proportion interface{} TaskKind interface{} Flag interface{} Inner struct { A interface{} } InnerRef struct { A interface{} } InnerMap interface{} }
TaskUpdateParam - params for strict updates
type UniqueMiddlewareKey ¶
type UniqueMiddlewareKey struct{}
Notes ¶
Bugs ¶
there may be potential bugs
there may be potential bugs
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by volcago.
|
Code generated by volcago. |
Code generated by volcago.
|
Code generated by volcago. |