Versions in this module Expand all Collapse all v1 v1.1.5 Mar 31, 2025 v1.1.4 Mar 14, 2025 Changes in this version + const ImmediatelyRefresh + const WaitForRefresh v1.1.3 Feb 28, 2025 v1.1.2 Feb 17, 2025 Changes in this version + func MapToStructWithJSONUnmarshal(source []byte, targetRef interface{}) error type ORM + SearchWithResultItemMapper func(resultArrayRef interface{}, ...) (error, SimpleResult) + type SimpleResult struct + Raw []byte + Total int64 + func SearchWithJSONMapper(o interface{}, q *Query) (error, SimpleResult) + func SearchWithResultItemMapper(o interface{}, itemMapFunc func(source []byte, targetRef interface{}) error, ...) (error, SimpleResult) v1.1.0 Jan 11, 2025 v1.0.0 Dec 16, 2024 Changes in this version + func Count(o interface{}, query interface{}) (int64, error) + func Create(ctx *Context, o interface{}) error + func Delete(ctx *Context, o interface{}) error + func DeleteBy(o interface{}, query interface{}) error + func FilterFieldsByProtected(obj interface{}, protected bool) map[string]interface + func Get(o interface{}) (bool, error) + func GetIndexName(o interface{}) string + func GetWildcardIndexName(o interface{}) string + func GroupBy(o interface{}, selectField, groupField, haveQuery string, ...) (error, map[string]interface{}) + func InitSchema() error + func MustRegisterSchemaWithIndexName(t interface{}, index string) + func Register(name string, h ORM) + func RegisterSchemaWithIndexName(t interface{}, index string) error + func Save(ctx *Context, o interface{}) error + func Update(ctx *Context, o interface{}) error + func UpdateBy(o interface{}, query interface{}) error + type BoolType string + const Must + const MustNot + const Should + type Cond struct + BoolType BoolType + Field string + QueryType QueryType + SQLOperator string + Value interface{} + func And(conds ...*Cond) []*Cond + func Combine(conds ...[]*Cond) []*Cond + func Eq(field string, value interface{}) *Cond + func Ge(field string, value interface{}) *Cond + func Gt(field string, value interface{}) *Cond + func In(field string, value []interface{}) *Cond + func InStringArray(field string, value []string) *Cond + func Le(field string, value interface{}) *Cond + func Lt(field string, value interface{}) *Cond + func NotEq(field string, value interface{}) *Cond + func Or(conds ...*Cond) []*Cond + type Context struct + Refresh string + type ORM interface + Count func(o interface{}, query interface{}) (int64, error) + Delete func(ctx *Context, o interface{}) error + DeleteBy func(o interface{}, query interface{}) error + Get func(o interface{}) (bool, error) + GetBy func(field string, value interface{}, o interface{}) (error, Result) + GetIndexName func(o interface{}) string + GetWildcardIndexName func(o interface{}) string + GroupBy func(o interface{}, selectField, groupField string, haveQuery string, ...) (error, map[string]interface{}) + RegisterSchemaWithIndexName func(t interface{}, indexName string) error + Save func(ctx *Context, o interface{}) error + Search func(o interface{}, q *Query) (error, Result) + Update func(ctx *Context, o interface{}) error + UpdateBy func(o interface{}, query interface{}) error + type ORMObjectBase struct + Created *time.Time + ID string + Updated *time.Time + func (obj *ORMObjectBase) GetID() string + func (obj *ORMObjectBase) SetID(ID string) + type Object interface + GetID func() string + SetID func(ID string) + type ProtectedFilterKeyType string + const ProtectedFilterKey + type Query struct + CollapseField string + Conds []*Cond + From int + IndexName string + QueryArgs *[]util.KV + RawQuery []byte + Size int + Sort *[]Sort + TemplatedQuery *TemplatedQuery + WildcardIndex bool + func (q *Query) AddQueryArgs(name string, value string) *Query + func (q *Query) AddSort(field string, sortType SortType) *Query + func (q *Query) Collapse(field string) *Query + type QueryType string + const Match + const Prefix + const RangeGt + const RangeGte + const RangeLt + const RangeLte + const Regexp + const StringTerms + const Term + const Terms + const Wildcard + type Result struct + Raw []byte + Result []interface{} + Total int64 + func GetBy(field string, value interface{}, t interface{}) (error, Result) + func Search(o interface{}, q *Query) (error, Result) + type Sort struct + Field string + SortType SortType + type SortType string + const ASC + const DESC + type TemplatedQuery struct + Parameters map[string]interface{} + TemplateID string