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)
Index ¶
- Constants
- Variables
- func IsSlice(v interface{}) bool
- func SetLastThreeToZero(t time.Time) time.Time
- type Cursor
- type DeleteMode
- type DeleteOption
- type Filter
- type FilterType
- type GetOption
- type LockMetaRepository
- type LockMetaRepositoryMiddleware
- type LockMetaSearchParam
- type LockMetaUpdateParam
- type MultiError
- type MultiErrors
- 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 RollbackFunc
- type Unique
- type UniqueMiddlewareKey
- type UniqueRepositoryMiddleware
- Bugs
Constants ¶
const ( LockMetaIndexLabelTextEqual = "t4" // perfect-match of Text LockMetaIndexLabelTextLike = "t3" // like-match of Text LockMetaIndexLabelTextPrefix = "t1" // prefix-match of Text LockMetaIndexLabelTextSuffix = "t2" // suffix-match of Text LockMetaIndexLabelFlagPrefix = "f1" // prefix-match of Flag LockMetaIndexLabelFlagSuffix = "f2" // suffix-match of Flag LockMetaIndexLabelFlagLike = "f3" // like-match of Flag LockMetaIndexLabelFlagEqual = "f4" // perfect-match of Flag LockMetaIndexLabelCreatedAtPrefix = "c1" // prefix-match of CreatedAt LockMetaIndexLabelCreatedAtSuffix = "c2" // suffix-match of CreatedAt LockMetaIndexLabelCreatedAtLike = "c3" // like-match of CreatedAt LockMetaIndexLabelCreatedAtEqual = "c4" // perfect-match of CreatedAt LockMetaIndexLabelCreatedByEqual = "c8" // perfect-match of CreatedBy LockMetaIndexLabelCreatedByLike = "c7" // like-match of CreatedBy LockMetaIndexLabelCreatedByPrefix = "c5" // prefix-match of CreatedBy LockMetaIndexLabelCreatedBySuffix = "c6" // suffix-match of CreatedBy LockMetaIndexLabelUpdatedAtPrefix = "u1" // prefix-match of UpdatedAt LockMetaIndexLabelUpdatedAtSuffix = "u2" // suffix-match of UpdatedAt LockMetaIndexLabelUpdatedAtLike = "u3" // like-match of UpdatedAt LockMetaIndexLabelUpdatedAtEqual = "u4" // perfect-match of UpdatedAt LockMetaIndexLabelUpdatedByEqual = "u8" // perfect-match of UpdatedBy LockMetaIndexLabelUpdatedByLike = "u7" // like-match of UpdatedBy LockMetaIndexLabelUpdatedByPrefix = "u5" // prefix-match of UpdatedBy LockMetaIndexLabelUpdatedBySuffix = "u6" // suffix-match of UpdatedBy LockMetaIndexLabelDeletedAtPrefix = "d1" // prefix-match of DeletedAt LockMetaIndexLabelDeletedAtSuffix = "d2" // suffix-match of DeletedAt LockMetaIndexLabelDeletedAtLike = "d3" // like-match of DeletedAt LockMetaIndexLabelDeletedAtEqual = "d4" // perfect-match of DeletedAt LockMetaIndexLabelDeletedByEqual = "d8" // perfect-match of DeletedBy LockMetaIndexLabelDeletedByLike = "d7" // like-match of DeletedBy LockMetaIndexLabelDeletedByPrefix = "d5" // prefix-match of DeletedBy LockMetaIndexLabelDeletedBySuffix = "d6" // suffix-match of DeletedBy LockMetaIndexLabelVersionPrefix = "v1" // prefix-match of Version LockMetaIndexLabelVersionSuffix = "v2" // suffix-match of Version LockMetaIndexLabelVersionLike = "v3" // like-match of Version LockMetaIndexLabelVersionEqual = "v4" // perfect-match of Version )
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 LockMetaRepository ¶
type LockMetaRepository interface { // Single Get(ctx context.Context, id string, opts ...GetOption) (*model.LockMeta, error) GetWithDoc(ctx context.Context, doc *firestore.DocumentRef, opts ...GetOption) (*model.LockMeta, error) Insert(ctx context.Context, subject *model.LockMeta) (_ string, err error) Update(ctx context.Context, subject *model.LockMeta) (err error) StrictUpdate(ctx context.Context, id string, param *LockMetaUpdateParam, opts ...firestore.Precondition) error Delete(ctx context.Context, subject *model.LockMeta, opts ...DeleteOption) (err error) DeleteByID(ctx context.Context, id string, opts ...DeleteOption) (err error) // Multiple GetMulti(ctx context.Context, ids []string, opts ...GetOption) ([]*model.LockMeta, error) InsertMulti(ctx context.Context, subjects []*model.LockMeta) (_ []string, er error) UpdateMulti(ctx context.Context, subjects []*model.LockMeta) (er error) DeleteMulti(ctx context.Context, subjects []*model.LockMeta, opts ...DeleteOption) (er error) DeleteMultiByIDs(ctx context.Context, ids []string, opts ...DeleteOption) (er error) // Single(Transaction) GetWithTx(tx *firestore.Transaction, id string, opts ...GetOption) (*model.LockMeta, error) GetWithDocWithTx(tx *firestore.Transaction, doc *firestore.DocumentRef, opts ...GetOption) (*model.LockMeta, error) InsertWithTx(ctx context.Context, tx *firestore.Transaction, subject *model.LockMeta) (_ string, err error) UpdateWithTx(ctx context.Context, tx *firestore.Transaction, subject *model.LockMeta) (err error) StrictUpdateWithTx(tx *firestore.Transaction, id string, param *LockMetaUpdateParam, opts ...firestore.Precondition) error DeleteWithTx(ctx context.Context, tx *firestore.Transaction, subject *model.LockMeta, 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) ([]*model.LockMeta, error) InsertMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*model.LockMeta) (_ []string, er error) UpdateMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*model.LockMeta) (er error) DeleteMultiWithTx(ctx context.Context, tx *firestore.Transaction, subjects []*model.LockMeta, opts ...DeleteOption) (er error) DeleteMultiByIDsWithTx(ctx context.Context, tx *firestore.Transaction, ids []string, opts ...DeleteOption) (er error) // Search Search(ctx context.Context, param *LockMetaSearchParam, q *firestore.Query) ([]*model.LockMeta, error) SearchWithTx(tx *firestore.Transaction, param *LockMetaSearchParam, q *firestore.Query) ([]*model.LockMeta, error) SearchByParam(ctx context.Context, param *LockMetaSearchParam) ([]*model.LockMeta, *PagingResult, error) SearchByParamWithTx(tx *firestore.Transaction, param *LockMetaSearchParam) ([]*model.LockMeta, *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) }
LockMetaRepository - Repository of LockMeta
func NewLockMetaRepository ¶
func NewLockMetaRepository(firestoreClient *firestore.Client, middleware ...LockMetaRepositoryMiddleware) LockMetaRepository
NewLockMetaRepository - constructor
type LockMetaRepositoryMiddleware ¶
type LockMetaRepositoryMiddleware interface { BeforeInsert(ctx context.Context, subject *model.LockMeta) (bool, error) BeforeUpdate(ctx context.Context, old, subject *model.LockMeta) (bool, error) BeforeDelete(ctx context.Context, subject *model.LockMeta, opts ...DeleteOption) (bool, error) BeforeDeleteByID(ctx context.Context, ids []string, opts ...DeleteOption) (bool, error) }
LockMetaRepositoryMiddleware - middleware of LockMetaRepository
type LockMetaSearchParam ¶
type LockMetaSearchParam struct { Text *QueryChainer Flag *QueryChainer CreatedAt *QueryChainer CreatedBy *QueryChainer UpdatedAt *QueryChainer UpdatedBy *QueryChainer DeletedAt *QueryChainer DeletedBy *QueryChainer Version *QueryChainer IncludeSoftDeleted bool CursorKey string CursorLimit int }
LockMetaSearchParam - params for search
type LockMetaUpdateParam ¶
type LockMetaUpdateParam struct { Text interface{} Flag interface{} CreatedAt interface{} CreatedBy interface{} UpdatedAt interface{} UpdatedBy interface{} DeletedAt interface{} DeletedBy interface{} Version interface{} }
LockMetaUpdateParam - params for strict updates
type MultiError ¶
MultiError - multi error interface
func NewMultiError ¶
func NewMultiError(index int, err error) MultiError
NewMultiError - constructor
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.4.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 UniqueMiddlewareKey ¶
type UniqueMiddlewareKey struct{}
Notes ¶
Bugs ¶
there may be potential bugs
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock
|
|
mock_lock_meta_gen
Package mock_model is a generated GoMock package.
|
Package mock_model is a generated GoMock package. |