Documentation ¶
Index ¶
- Constants
- func AnyDateTimeValue(any jsoniter.Any) (t time.Time, err error)
- func AnyDateValue(any jsoniter.Any) (t time.Time, err error)
- func AnyFloat64Value(any jsoniter.Any, def float64) (float64, error)
- func AnyIntArrayValue(any jsoniter.Any) ([]int, error)
- func AnyIntValue(any jsoniter.Any, def int) (int, error)
- func AnyStringArrayValue(any jsoniter.Any) ([]string, error)
- func AnyStringValue(any jsoniter.Any, def string) (string, error)
- func DateTimeValue(m bson.M, name string) (t time.Time, err error)
- func DateToNumber(date time.Time) int
- func DateValue(m bson.M, name string) (t time.Time, err error)
- func EmbeddedValue(m bson.M, name string) (bson.M, error)
- func FixedEmbedded(m bson.M, name string) bson.M
- func Float64Value(m bson.M, name string, def float64) (float64, error)
- func IntArrayValue(m bson.M, name string) ([]int, error)
- func IntValue(m bson.M, name string, def int) (int, error)
- func NumberToDate(num int) time.Time
- func StringArrayValue(m bson.M, name string) ([]string, error)
- func StringValue(m bson.M, name string, def string) (string, error)
- type BaseIntObjectMapValue
- type BaseStringObjectMapValue
- type BsonModel
- type DocumentModel
- type DotNotation
- type IntObjectMapModel
- type IntObjectMapValueFactory
- type IntObjectMapValueModel
- type IntSimpleMapModel
- type MapValueModel
- type ObjectModel
- type RootModel
- type SimpleValueType
- type StringObjectMapModel
- type StringObjectMapValueFactory
- type StringObjectMapValueModel
- type StringSimpleMapModel
Constants ¶
View Source
const Version = "1.0.0-dev"
Variables ¶
This section is empty.
Functions ¶
func DateToNumber ¶
func NumberToDate ¶
Types ¶
type BaseIntObjectMapValue ¶
type BaseIntObjectMapValue struct {
// contains filtered or unexported fields
}
func (*BaseIntObjectMapValue) EmitUpdated ¶
func (v *BaseIntObjectMapValue) EmitUpdated()
func (*BaseIntObjectMapValue) Key ¶
func (v *BaseIntObjectMapValue) Key() int
func (*BaseIntObjectMapValue) Parent ¶
func (v *BaseIntObjectMapValue) Parent() BsonModel
func (*BaseIntObjectMapValue) XPath ¶
func (v *BaseIntObjectMapValue) XPath() DotNotation
type BaseStringObjectMapValue ¶
type BaseStringObjectMapValue struct {
// contains filtered or unexported fields
}
func (*BaseStringObjectMapValue) EmitUpdated ¶
func (v *BaseStringObjectMapValue) EmitUpdated()
func (*BaseStringObjectMapValue) Key ¶
func (v *BaseStringObjectMapValue) Key() string
func (*BaseStringObjectMapValue) Parent ¶
func (v *BaseStringObjectMapValue) Parent() BsonModel
func (*BaseStringObjectMapValue) XPath ¶
func (v *BaseStringObjectMapValue) XPath() DotNotation
type BsonModel ¶
type BsonModel interface { ToBson() interface{} ToData() interface{} LoadJsoniter(any jsoniter.Any) error Reset() AnyUpdated() bool AnyDeleted() bool Parent() BsonModel XPath() DotNotation AppendUpdates(updates bson.M) bson.M ToSync() interface{} ToDelete() interface{} ToDataJson() (string, error) ToSyncJson() (string, error) ToDeleteJson() (string, error) }
The top interface for BSON model.
type DocumentModel ¶
type DotNotation ¶
type DotNotation interface { Value() string IsRoot() bool Resolve(name string) DotNotation ResolveIndex(index int) DotNotation }
DotNotation defines BSON dot notation.
func PathOf ¶
func PathOf(base DotNotation, names ...string) DotNotation
func PathOfNames ¶
func PathOfNames(base string, names ...string) DotNotation
func RootPath ¶
func RootPath() DotNotation
type IntObjectMapModel ¶
type IntObjectMapModel interface { Keys() []int Get(key int) IntObjectMapValueModel Put(key int, value IntObjectMapValueModel) IntObjectMapValueModel Remove(key int) bool SetUpdated(key string) // contains filtered or unexported methods }
func NewIntObjectMapModel ¶
func NewIntObjectMapModel(parent BsonModel, name string, valueFactory IntObjectMapValueFactory) IntObjectMapModel
type IntObjectMapValueFactory ¶
type IntObjectMapValueFactory func() IntObjectMapValueModel
type IntObjectMapValueModel ¶
type IntObjectMapValueModel interface { MapValueModel Key() int // contains filtered or unexported methods }
type IntSimpleMapModel ¶
type IntSimpleMapModel interface { Keys() []int Get(key int) interface{} Put(key int, value interface{}) interface{} Remove(key int) bool // contains filtered or unexported methods }
func NewIntSimpleMapModel ¶
func NewIntSimpleMapModel(parent BsonModel, name string, valueType SimpleValueType) IntSimpleMapModel
type MapValueModel ¶
type MapValueModel interface { ObjectModel EmitUpdated() // contains filtered or unexported methods }
type ObjectModel ¶
type ObjectModel interface { DocumentModel FullyUpdate() bool SetFullyUpdate(fullyUpdate bool) }
type RootModel ¶
type RootModel interface { ObjectModel ToUpdate() bson.M MarshalToJsonString() (string, error) }
type SimpleValueType ¶
type SimpleValueType interface { Parse(value interface{}) (interface{}, error) ParseJsoniter(value jsoniter.Any) (interface{}, error) ToBson(value interface{}) interface{} ToData(value interface{}) interface{} }
func BoolValueType ¶
func BoolValueType() SimpleValueType
func DateSimpleValueType ¶
func DateSimpleValueType() SimpleValueType
func DateTimeSimpleValueType ¶
func DateTimeSimpleValueType() SimpleValueType
func Float64ValueType ¶
func Float64ValueType() SimpleValueType
func IntValueType ¶
func IntValueType() SimpleValueType
func StringValeType ¶
func StringValeType() SimpleValueType
type StringObjectMapModel ¶
type StringObjectMapModel interface { Keys() []string Get(key string) StringObjectMapValueModel Put(key string, value StringObjectMapValueModel) StringObjectMapValueModel Remove(key string) bool SetUpdated(key string) // contains filtered or unexported methods }
func NewStringObjectMapModel ¶
func NewStringObjectMapModel(parent BsonModel, name string, valueFactory StringObjectMapValueFactory) StringObjectMapModel
type StringObjectMapValueFactory ¶
type StringObjectMapValueFactory func() StringObjectMapValueModel
type StringObjectMapValueModel ¶
type StringObjectMapValueModel interface { MapValueModel Key() string // contains filtered or unexported methods }
type StringSimpleMapModel ¶
type StringSimpleMapModel interface { Keys() []string Get(key string) interface{} Put(key string, value interface{}) interface{} Remove(key string) bool // contains filtered or unexported methods }
func NewStringSimpleMapModel ¶
func NewStringSimpleMapModel(parent BsonModel, name string, valueType SimpleValueType) StringSimpleMapModel
Click to show internal directories.
Click to hide internal directories.