Documentation
¶
Index ¶
- Constants
- Variables
- type BoltCollection
- func (instance *BoltCollection) Count() (int64, error)
- func (instance *BoltCollection) CountByFieldValue(fieldName string, fieldValue interface{}) (int64, error)
- func (instance *BoltCollection) Drop() error
- func (instance *BoltCollection) EnableExpire(value bool)
- func (instance *BoltCollection) Find(query *BoltQuery) ([]interface{}, error)
- func (instance *BoltCollection) ForEach(callback ForEachCallback) error
- func (instance *BoltCollection) Get(key string) (interface{}, error)
- func (instance *BoltCollection) GetByFieldValue(fieldName string, fieldValue interface{}) ([]interface{}, error)
- func (instance *BoltCollection) Remove(key string) error
- func (instance *BoltCollection) RemoveBatch(key string) error
- func (instance *BoltCollection) Upsert(entity interface{}) error
- func (instance *BoltCollection) UpsertBatch(entity interface{}) error
- type BoltConfig
- type BoltDatabase
- func (instance *BoltDatabase) Close() error
- func (instance *BoltDatabase) Collection(name string, createIfNotExists bool) (*BoltCollection, error)
- func (instance *BoltDatabase) CollectionAutoCreate(name string) (*BoltCollection, error)
- func (instance *BoltDatabase) Drop() error
- func (instance *BoltDatabase) Error() error
- func (instance *BoltDatabase) HasError() bool
- func (instance *BoltDatabase) Name() string
- func (instance *BoltDatabase) Open() error
- func (instance *BoltDatabase) Size() (int64, error)
- type BoltQuery
- type BoltQueryCondition
- type BoltQueryConditionGroup
- type ExpireItem
- type ExpireWorker
- type ExpireWorkerJob
- type ForEachCallback
Constants ¶
View Source
const ( ComparatorEqual = "==" ComparatorNotEqual = "!=" ComparatorGreater = ">" ComparatorLower = "<" ComparatorLowerEqual = "<=" ComparatorGreaterEqual = ">=" OperatorAnd = "&&" OperatorOr = "||" )
View Source
const (
FieldExpire = "_expire"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BoltCollection ¶
type BoltCollection struct {
// contains filtered or unexported fields
}
func NewBoltCollection ¶
func NewBoltCollection(db *BoltDatabase, boltdb *bbolt.DB, name string) *BoltCollection
func (*BoltCollection) Count ¶
func (instance *BoltCollection) Count() (int64, error)
func (*BoltCollection) CountByFieldValue ¶
func (instance *BoltCollection) CountByFieldValue(fieldName string, fieldValue interface{}) (int64, error)
func (*BoltCollection) Drop ¶
func (instance *BoltCollection) Drop() error
func (*BoltCollection) EnableExpire ¶
func (instance *BoltCollection) EnableExpire(value bool)
func (*BoltCollection) Find ¶
func (instance *BoltCollection) Find(query *BoltQuery) ([]interface{}, error)
func (*BoltCollection) ForEach ¶
func (instance *BoltCollection) ForEach(callback ForEachCallback) error
func (*BoltCollection) Get ¶
func (instance *BoltCollection) Get(key string) (interface{}, error)
func (*BoltCollection) GetByFieldValue ¶
func (instance *BoltCollection) GetByFieldValue(fieldName string, fieldValue interface{}) ([]interface{}, error)
func (*BoltCollection) Remove ¶
func (instance *BoltCollection) Remove(key string) error
func (*BoltCollection) RemoveBatch ¶
func (instance *BoltCollection) RemoveBatch(key string) error
func (*BoltCollection) Upsert ¶
func (instance *BoltCollection) Upsert(entity interface{}) error
func (*BoltCollection) UpsertBatch ¶
func (instance *BoltCollection) UpsertBatch(entity interface{}) error
type BoltConfig ¶
func NewBoltConfig ¶
func NewBoltConfig() *BoltConfig
func (*BoltConfig) Parse ¶
func (instance *BoltConfig) Parse(text string) error
func (*BoltConfig) ToString ¶
func (instance *BoltConfig) ToString() string
type BoltDatabase ¶
type BoltDatabase struct {
// contains filtered or unexported fields
}
func NewBoltDatabase ¶
func NewBoltDatabase(config *BoltConfig) *BoltDatabase
func (*BoltDatabase) Close ¶
func (instance *BoltDatabase) Close() error
func (*BoltDatabase) Collection ¶
func (instance *BoltDatabase) Collection(name string, createIfNotExists bool) (*BoltCollection, error)
func (*BoltDatabase) CollectionAutoCreate ¶
func (instance *BoltDatabase) CollectionAutoCreate(name string) (*BoltCollection, error)
func (*BoltDatabase) Drop ¶
func (instance *BoltDatabase) Drop() error
func (*BoltDatabase) Error ¶
func (instance *BoltDatabase) Error() error
func (*BoltDatabase) HasError ¶
func (instance *BoltDatabase) HasError() bool
func (*BoltDatabase) Name ¶
func (instance *BoltDatabase) Name() string
func (*BoltDatabase) Open ¶
func (instance *BoltDatabase) Open() error
func (*BoltDatabase) Size ¶
func (instance *BoltDatabase) Size() (int64, error)
type BoltQuery ¶
type BoltQuery struct {
Conditions []*BoltQueryConditionGroup `json:"conditions"`
}
func NewQueryFromFile ¶
func (*BoltQuery) MatchFilter ¶
type BoltQueryCondition ¶
type BoltQueryCondition struct { Field interface{} `json:"field"` // absolute value or field "doc.name" Comparator string `json:"comparator"` // ==, !=, > ... Value interface{} `json:"value"` // absolute value or field "doc.surname", "Rossi" }
type BoltQueryConditionGroup ¶
type BoltQueryConditionGroup struct { Operator string `json:"operator"` Filters []*BoltQueryCondition `json:"filters"` }
type ExpireItem ¶
type ExpireItem struct {
Exp int64 `json:"_expire"`
}
type ExpireWorker ¶
type ExpireWorker struct {
// contains filtered or unexported fields
}
func NewExpireWorker ¶
func NewExpireWorker(db *BoltDatabase) *ExpireWorker
func (*ExpireWorker) Disable ¶
func (instance *ExpireWorker) Disable(collectionName string)
func (*ExpireWorker) Enable ¶
func (instance *ExpireWorker) Enable(collectionName string)
type ExpireWorkerJob ¶
type ExpireWorkerJob struct {
// contains filtered or unexported fields
}
func (*ExpireWorkerJob) Stop ¶
func (instance *ExpireWorkerJob) Stop()
type ForEachCallback ¶
Click to show internal directories.
Click to hide internal directories.