rapidash: go.knocknote.io/rapidash Index | Files | Directories

package rapidash

import "go.knocknote.io/rapidash"

Index

Package Files

addr.go btree.go coder.go config.go decoder.go encoder.go error.go first_level_cache.go index.go last_level_cache.go log.go option.go query_builder.go rapidash.go second_level_cache.go type.go

Constants

const (
    Order     = 4
    BranchNum = Order
    KeyNum    = Order - 1
)
const (
    CacheKeyQueryDelimiter         = "&"
    CacheKeyQueryKeyValueDelimiter = "#"
)

Variables

var (
    ErrBeginTransaction            = xerrors.New("failed begin cache transaction. required single connection instance or nothing")
    ErrConnectionOfTransaction     = xerrors.New("connection instance ( like sql.DB or sql.Tx ) is required for (*Rapidash).Begin()")
    ErrAlreadyCommittedTransaction = xerrors.New("transaction is already committed")
    ErrUnlockCacheKeys             = xerrors.New("failed unlock cache keys")
    ErrCacheCommit                 = xerrors.New("failed cache commit")
    ErrCleanUpCache                = xerrors.New("failed clean up cache")
    ErrRecoverCache                = xerrors.New("failed recover cache")
)
var (
    ErrInvalidQuery         = xerrors.New("query builder includes not equal query")
    ErrLookUpIndexFromQuery = xerrors.New("cannot lookup index from query")
    ErrMultipleINQueries    = xerrors.New("multiple IN queries are not supported")
    ErrInvalidColumnType    = xerrors.New("invalid column type")
)
var (
    ErrRecordNotFoundByPrimaryKey = xerrors.New("cannot find record by primary key")
    ErrInvalidLeafs               = xerrors.New("failed to find values. ( invalid leafs )")
)
var (
    ErrCacheMiss                           = xerrors.New("cache miss hit")
    ErrCreatePrimaryKeyCacheBySlice        = xerrors.New("cannot create cache for primary key with slice value")
    ErrCreateUniqueKeyCacheBySlice         = xerrors.New("cannot create cache for unique key with slice value")
    ErrCreateCacheKeyAtMultiplePrimaryKeys = xerrors.New("cannot find by primary key because table is set multiple primary keys")
)
var (
    ErrScanToNilValue    = xerrors.New("cannot scan to nil value")
    ErrUnknownColumnType = xerrors.New("unknown column type")
    ErrUnknownColumnName = xerrors.New("unknown column name")
    ErrInvalidDecodeType = xerrors.New("invalid decode type")
    ErrInvalidEncodeType = xerrors.New("invalid encode type")
)
var (
    ErrInvalidCacheKey = xerrors.New("invalid cache key")
)

func IsCacheMiss Uses

func IsCacheMiss(err error) bool

func IsMaxIdleConnections Uses

func IsMaxIdleConnections(err error) bool

func IsTimeout Uses

func IsTimeout(err error) bool

type BTree Uses

type BTree struct {
    // contains filtered or unexported fields
}

func NewBTree Uses

func NewBTree() *BTree

type BoolCoder Uses

type BoolCoder struct {
    // contains filtered or unexported fields
}

func Bool Uses

func Bool(v bool) *BoolCoder

func BoolPtr Uses

func BoolPtr(v *bool) *BoolCoder

func (*BoolCoder) Decode Uses

func (c *BoolCoder) Decode(content []byte) error

func (*BoolCoder) Encode Uses

func (c *BoolCoder) Encode() ([]byte, error)

type BoolsCoder Uses

type BoolsCoder struct {
    // contains filtered or unexported fields
}

func Bools Uses

func Bools(v []bool) *BoolsCoder

func BoolsPtr Uses

func BoolsPtr(v *[]bool) *BoolsCoder

func (*BoolsCoder) Decode Uses

func (c *BoolsCoder) Decode(content []byte) error

func (*BoolsCoder) Encode Uses

func (c *BoolsCoder) Encode() ([]byte, error)

type BytesCoder Uses

type BytesCoder struct {
    // contains filtered or unexported fields
}

func Bytes Uses

func Bytes(v []byte) *BytesCoder

func BytesPtr Uses

func BytesPtr(v *[]byte) *BytesCoder

func (*BytesCoder) Decode Uses

func (c *BytesCoder) Decode(content []byte) error

func (*BytesCoder) Encode Uses

func (c *BytesCoder) Encode() ([]byte, error)

type CacheControlConfig Uses

type CacheControlConfig struct {
    OptimisticLock  *bool `yaml:"optimistic_lock"`
    PessimisticLock *bool `yaml:"pessimistic_lock"`
}

func (*CacheControlConfig) LLCOptions Uses

func (cfg *CacheControlConfig) LLCOptions() []OptionFunc

func (*CacheControlConfig) SLCOptions Uses

func (cfg *CacheControlConfig) SLCOptions() []OptionFunc

func (*CacheControlConfig) TableOptions Uses

func (cfg *CacheControlConfig) TableOptions(table string) []OptionFunc

func (*CacheControlConfig) TagOptions Uses

func (cfg *CacheControlConfig) TagOptions(tag string) []OptionFunc

type CacheKey Uses

type CacheKey struct {
    // contains filtered or unexported fields
}

func (CacheKey) Addr Uses

func (c CacheKey) Addr() net.Addr

func (CacheKey) Hash Uses

func (c CacheKey) Hash() uint32

func (CacheKey) LockKey Uses

func (c CacheKey) LockKey() server.CacheKey

func (CacheKey) String Uses

func (c CacheKey) String() string

func (CacheKey) Type Uses

func (c CacheKey) Type() server.CacheKeyType

type CacheServerType Uses

type CacheServerType int
const (
    CacheServerTypeMemcached CacheServerType = iota
    CacheServerTypeRedis
    CacheServerTypeOnMemory

    // DefaultTimeout is the default socket read/write timeout.
    DefaultTimeout = 100 * time.Millisecond
    // DefaultMaxIdleConns is the default maximum number of idle connections
    // kept for any single address.
    DefaultMaxIdleConns = 2
)

type Coder Uses

type Coder interface {
    Marshaler
    Unmarshaler
}

type Condition Uses

type Condition interface {
    Value() *Value
    Column() string
    Compare(v *Value) bool
    Search(*BTree) []Leaf
    Query() string
    QueryArgs() []interface{}
    Build(*ValueFactory)
    Release()
}

type Conditions Uses

type Conditions struct {
    // contains filtered or unexported fields
}

func (*Conditions) Append Uses

func (c *Conditions) Append(condition Condition)

func (*Conditions) Build Uses

func (c *Conditions) Build(factory *ValueFactory)

func (*Conditions) Columns Uses

func (c *Conditions) Columns() []string

func (*Conditions) Current Uses

func (c *Conditions) Current() Condition

func (*Conditions) Len Uses

func (c *Conditions) Len() int

func (*Conditions) Next Uses

func (c *Conditions) Next() *Conditions

func (*Conditions) Queries Uses

func (c *Conditions) Queries() []string

func (*Conditions) Release Uses

func (c *Conditions) Release()

func (*Conditions) Reset Uses

func (c *Conditions) Reset()

type Config Uses

type Config struct {
    Rule *RuleConfig `yaml:"rule"`
    SLC  *SLCConfig  `yaml:"slc"`
    LLC  *LLCConfig  `yaml:"llc"`
}

func NewConfig Uses

func NewConfig(path string) (*Config, error)

func (*Config) Options Uses

func (cfg *Config) Options() []OptionFunc

type Connection Uses

type Connection interface {
    QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
    ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
}

type Decoder Uses

type Decoder interface {
    Len() int
    At(int) Decoder
    Int(string) int
    Int8(string) int8
    Int16(string) int16
    Int32(string) int32
    Int64(string) int64
    Uint(string) uint
    Uint8(string) uint8
    Uint16(string) uint16
    Uint32(string) uint32
    Uint64(string) uint64
    Float32(string) float32
    Float64(string) float64
    Bool(string) bool
    String(string) string
    Bytes(string) []byte
    Time(string) time.Time
    Slice(string, Unmarshaler)
    Struct(string, Unmarshaler)
    IntPtr(string) *int
    Int8Ptr(string) *int8
    Int16Ptr(string) *int16
    Int32Ptr(string) *int32
    Int64Ptr(string) *int64
    UintPtr(string) *uint
    Uint8Ptr(string) *uint8
    Uint16Ptr(string) *uint16
    Uint32Ptr(string) *uint32
    Uint64Ptr(string) *uint64
    Float32Ptr(string) *float32
    Float64Ptr(string) *float64
    BoolPtr(string) *bool
    StringPtr(string) *string
    BytesPtr(string) *[]byte
    TimePtr(string) *time.Time
    Ints(string) []int
    Int8s(string) []int8
    Int16s(string) []int16
    Int32s(string) []int32
    Int64s(string) []int64
    Uints(string) []uint
    Uint8s(string) []uint8
    Uint16s(string) []uint16
    Uint32s(string) []uint32
    Uint64s(string) []uint64
    Float32s(string) []float32
    Float64s(string) []float64
    Bools(string) []bool
    Strings(string) []string
    Times(string) []time.Time
    Error() error
}

type DefaultLogger Uses

type DefaultLogger struct {
    // contains filtered or unexported fields
}

func (*DefaultLogger) Add Uses

func (dl *DefaultLogger) Add(id string, key server.CacheKey, value LogEncoder)

func (*DefaultLogger) Delete Uses

func (dl *DefaultLogger) Delete(id string, typ SLCType, key server.CacheKey)

func (*DefaultLogger) DeleteFromDB Uses

func (dl *DefaultLogger) DeleteFromDB(id, sql string)

func (*DefaultLogger) Get Uses

func (dl *DefaultLogger) Get(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*DefaultLogger) GetFromDB Uses

func (dl *DefaultLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)

func (*DefaultLogger) GetMulti Uses

func (dl *DefaultLogger) GetMulti(id string, typ SLCType, key []server.CacheKey, value LogEncoder)

func (*DefaultLogger) InsertIntoDB Uses

func (dl *DefaultLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)

func (*DefaultLogger) Set Uses

func (dl *DefaultLogger) Set(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*DefaultLogger) Update Uses

func (dl *DefaultLogger) Update(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*DefaultLogger) UpdateForDB Uses

func (dl *DefaultLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)

func (*DefaultLogger) Warn Uses

func (*DefaultLogger) Warn(msg string)

type EQCondition Uses

type EQCondition struct {
    // contains filtered or unexported fields
}

func (*EQCondition) Build Uses

func (c *EQCondition) Build(factory *ValueFactory)

func (*EQCondition) Column Uses

func (c *EQCondition) Column() string

func (*EQCondition) Compare Uses

func (c *EQCondition) Compare(value *Value) bool

func (*EQCondition) Query Uses

func (c *EQCondition) Query() string

func (*EQCondition) QueryArgs Uses

func (c *EQCondition) QueryArgs() []interface{}

func (*EQCondition) Release Uses

func (c *EQCondition) Release()

func (*EQCondition) Search Uses

func (c *EQCondition) Search(tree *BTree) []Leaf

func (*EQCondition) Value Uses

func (c *EQCondition) Value() *Value

type Encoder Uses

type Encoder interface {
    Error() error
    New() Encoder

    Int(string, int)
    Int8(string, int8)
    Int16(string, int16)
    Int32(string, int32)
    Int64(string, int64)
    Uint(string, uint)
    Uint8(string, uint8)
    Uint16(string, uint16)
    Uint32(string, uint32)
    Uint64(string, uint64)
    Float32(string, float32)
    Float64(string, float64)
    String(string, string)
    Bytes(string, []byte)
    Bool(string, bool)
    Time(string, time.Time)

    IntPtr(string, *int)
    Int8Ptr(string, *int8)
    Int16Ptr(string, *int16)
    Int32Ptr(string, *int32)
    Int64Ptr(string, *int64)
    UintPtr(string, *uint)
    Uint8Ptr(string, *uint8)
    Uint16Ptr(string, *uint16)
    Uint32Ptr(string, *uint32)
    Uint64Ptr(string, *uint64)
    Float32Ptr(string, *float32)
    Float64Ptr(string, *float64)
    StringPtr(string, *string)
    BytesPtr(string, *[]byte)
    BoolPtr(string, *bool)
    TimePtr(string, *time.Time)
    Struct(string, Marshaler)

    Ints(string, []int)
    Int8s(string, []int8)
    Int16s(string, []int16)
    Int32s(string, []int32)
    Int64s(string, []int64)
    Uints(string, []uint)
    Uint8s(string, []uint8)
    Uint16s(string, []uint16)
    Uint32s(string, []uint32)
    Uint64s(string, []uint64)
    Float32s(string, []float32)
    Float64s(string, []float64)
    Strings(string, []string)
    Bools(string, []bool)
    Times(string, []time.Time)
    Structs(string, Marshaler)
}

type FirstLevelCache Uses

type FirstLevelCache struct {
    // contains filtered or unexported fields
}

func NewFirstLevelCache Uses

func NewFirstLevelCache(s *Struct) *FirstLevelCache

func (*FirstLevelCache) CountByQueryBuilder Uses

func (c *FirstLevelCache) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)

func (*FirstLevelCache) FindAll Uses

func (c *FirstLevelCache) FindAll(unmarshaler Unmarshaler) error

func (*FirstLevelCache) FindByPrimaryKey Uses

func (c *FirstLevelCache) FindByPrimaryKey(key *Value, unmarshaler Unmarshaler) error

func (*FirstLevelCache) FindByQueryBuilder Uses

func (c *FirstLevelCache) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error

func (*FirstLevelCache) WarmUp Uses

func (c *FirstLevelCache) WarmUp(conn *sql.DB) (e error)

type FirstLevelCacheMap Uses

type FirstLevelCacheMap struct {
    *sync.Map
}

func NewFirstLevelCacheMap Uses

func NewFirstLevelCacheMap() *FirstLevelCacheMap

type Float32Coder Uses

type Float32Coder struct {
    // contains filtered or unexported fields
}

func Float32 Uses

func Float32(v float32) *Float32Coder

func Float32Ptr Uses

func Float32Ptr(v *float32) *Float32Coder

func (*Float32Coder) Decode Uses

func (c *Float32Coder) Decode(content []byte) error

func (*Float32Coder) Encode Uses

func (c *Float32Coder) Encode() ([]byte, error)

type Float32sCoder Uses

type Float32sCoder struct {
    // contains filtered or unexported fields
}

func Float32s Uses

func Float32s(v []float32) *Float32sCoder

func Float32sPtr Uses

func Float32sPtr(v *[]float32) *Float32sCoder

func (*Float32sCoder) Decode Uses

func (c *Float32sCoder) Decode(content []byte) error

func (*Float32sCoder) Encode Uses

func (c *Float32sCoder) Encode() ([]byte, error)

type Float64Coder Uses

type Float64Coder struct {
    // contains filtered or unexported fields
}

func Float64 Uses

func Float64(v float64) *Float64Coder

func Float64Ptr Uses

func Float64Ptr(v *float64) *Float64Coder

func (*Float64Coder) Decode Uses

func (c *Float64Coder) Decode(content []byte) error

func (*Float64Coder) Encode Uses

func (c *Float64Coder) Encode() ([]byte, error)

type Float64sCoder Uses

type Float64sCoder struct {
    // contains filtered or unexported fields
}

func Float64s Uses

func Float64s(v []float64) *Float64sCoder

func Float64sPtr Uses

func Float64sPtr(v *[]float64) *Float64sCoder

func (*Float64sCoder) Decode Uses

func (c *Float64sCoder) Decode(content []byte) error

func (*Float64sCoder) Encode Uses

func (c *Float64sCoder) Encode() ([]byte, error)

type GTCondition Uses

type GTCondition struct {
    // contains filtered or unexported fields
}

func (*GTCondition) Build Uses

func (c *GTCondition) Build(factory *ValueFactory)

func (*GTCondition) Column Uses

func (c *GTCondition) Column() string

func (*GTCondition) Compare Uses

func (c *GTCondition) Compare(value *Value) bool

func (*GTCondition) Query Uses

func (c *GTCondition) Query() string

func (*GTCondition) QueryArgs Uses

func (c *GTCondition) QueryArgs() []interface{}

func (*GTCondition) Release Uses

func (c *GTCondition) Release()

func (*GTCondition) Search Uses

func (c *GTCondition) Search(tree *BTree) []Leaf

func (*GTCondition) Value Uses

func (c *GTCondition) Value() *Value

type GTECondition Uses

type GTECondition struct {
    // contains filtered or unexported fields
}

func (*GTECondition) Build Uses

func (c *GTECondition) Build(factory *ValueFactory)

func (*GTECondition) Column Uses

func (c *GTECondition) Column() string

func (*GTECondition) Compare Uses

func (c *GTECondition) Compare(value *Value) bool

func (*GTECondition) Query Uses

func (c *GTECondition) Query() string

func (*GTECondition) QueryArgs Uses

func (c *GTECondition) QueryArgs() []interface{}

func (*GTECondition) Release Uses

func (c *GTECondition) Release()

func (*GTECondition) Search Uses

func (c *GTECondition) Search(tree *BTree) []Leaf

func (*GTECondition) Value Uses

func (c *GTECondition) Value() *Value

type INCondition Uses

type INCondition struct {
    // contains filtered or unexported fields
}

func (*INCondition) Build Uses

func (c *INCondition) Build(factory *ValueFactory)

func (*INCondition) Column Uses

func (c *INCondition) Column() string

func (*INCondition) Compare Uses

func (c *INCondition) Compare(value *Value) bool

func (*INCondition) Query Uses

func (c *INCondition) Query() string

func (*INCondition) QueryArgs Uses

func (c *INCondition) QueryArgs() []interface{}

func (*INCondition) Release Uses

func (c *INCondition) Release()

func (*INCondition) Search Uses

func (c *INCondition) Search(tree *BTree) []Leaf

func (*INCondition) Value Uses

func (c *INCondition) Value() *Value

type Index Uses

type Index struct {
    Type          IndexType
    Table         string
    Option        *TableOption
    Columns       []string
    ColumnTypeMap map[string]TypeID
    // contains filtered or unexported fields
}

func NewKey Uses

func NewKey(opt *TableOption, tableName string, columns []string, typ *Struct) *Index

func NewPrimaryKey Uses

func NewPrimaryKey(opt *TableOption, tableName string, columns []string, typ *Struct) *Index

func NewUniqueKey Uses

func NewUniqueKey(opt *TableOption, tableName string, columns []string, typ *Struct) *Index

func (*Index) CacheKey Uses

func (i *Index) CacheKey(value *StructValue) (*CacheKey, error)

func (*Index) CacheKeys Uses

func (i *Index) CacheKeys(slice *StructSliceValue) ([]server.CacheKey, error)

func (*Index) HasColumn Uses

func (i *Index) HasColumn(col string) bool

type IndexType Uses

type IndexType int
const (
    IndexTypeUniqueKey IndexType = iota
    IndexTypeKey
    IndexTypePrimaryKey
)

type Int16Coder Uses

type Int16Coder struct {
    // contains filtered or unexported fields
}

func Int16 Uses

func Int16(v int16) *Int16Coder

func Int16Ptr Uses

func Int16Ptr(v *int16) *Int16Coder

func (*Int16Coder) Decode Uses

func (c *Int16Coder) Decode(content []byte) error

func (*Int16Coder) Encode Uses

func (c *Int16Coder) Encode() ([]byte, error)

type Int16sCoder Uses

type Int16sCoder struct {
    // contains filtered or unexported fields
}

func Int16s Uses

func Int16s(v []int16) *Int16sCoder

func Int16sPtr Uses

func Int16sPtr(v *[]int16) *Int16sCoder

func (*Int16sCoder) Decode Uses

func (c *Int16sCoder) Decode(content []byte) error

func (*Int16sCoder) Encode Uses

func (c *Int16sCoder) Encode() ([]byte, error)

type Int32Coder Uses

type Int32Coder struct {
    // contains filtered or unexported fields
}

func Int32 Uses

func Int32(v int32) *Int32Coder

func Int32Ptr Uses

func Int32Ptr(v *int32) *Int32Coder

func (*Int32Coder) Decode Uses

func (c *Int32Coder) Decode(content []byte) error

func (*Int32Coder) Encode Uses

func (c *Int32Coder) Encode() ([]byte, error)

type Int32sCoder Uses

type Int32sCoder struct {
    // contains filtered or unexported fields
}

func Int32s Uses

func Int32s(v []int32) *Int32sCoder

func Int32sPtr Uses

func Int32sPtr(v *[]int32) *Int32sCoder

func (*Int32sCoder) Decode Uses

func (c *Int32sCoder) Decode(content []byte) error

func (*Int32sCoder) Encode Uses

func (c *Int32sCoder) Encode() ([]byte, error)

type Int64Coder Uses

type Int64Coder struct {
    // contains filtered or unexported fields
}

func Int64 Uses

func Int64(v int64) *Int64Coder

func Int64Ptr Uses

func Int64Ptr(v *int64) *Int64Coder

func (*Int64Coder) Decode Uses

func (c *Int64Coder) Decode(content []byte) error

func (*Int64Coder) Encode Uses

func (c *Int64Coder) Encode() ([]byte, error)

type Int64sCoder Uses

type Int64sCoder struct {
    // contains filtered or unexported fields
}

func Int64s Uses

func Int64s(v []int64) *Int64sCoder

func Int64sPtr Uses

func Int64sPtr(v *[]int64) *Int64sCoder

func (*Int64sCoder) Decode Uses

func (c *Int64sCoder) Decode(content []byte) error

func (*Int64sCoder) Encode Uses

func (c *Int64sCoder) Encode() ([]byte, error)

type Int8Coder Uses

type Int8Coder struct {
    // contains filtered or unexported fields
}

func Int8 Uses

func Int8(v int8) *Int8Coder

func Int8Ptr Uses

func Int8Ptr(v *int8) *Int8Coder

func (*Int8Coder) Decode Uses

func (c *Int8Coder) Decode(content []byte) error

func (*Int8Coder) Encode Uses

func (c *Int8Coder) Encode() ([]byte, error)

type Int8sCoder Uses

type Int8sCoder struct {
    // contains filtered or unexported fields
}

func Int8s Uses

func Int8s(v []int8) *Int8sCoder

func Int8sPtr Uses

func Int8sPtr(v *[]int8) *Int8sCoder

func (*Int8sCoder) Decode Uses

func (c *Int8sCoder) Decode(content []byte) error

func (*Int8sCoder) Encode Uses

func (c *Int8sCoder) Encode() ([]byte, error)

type IntCoder Uses

type IntCoder struct {
    // contains filtered or unexported fields
}

func Int Uses

func Int(v int) *IntCoder

func IntPtr Uses

func IntPtr(v *int) *IntCoder

func (*IntCoder) Decode Uses

func (c *IntCoder) Decode(content []byte) error

func (*IntCoder) Encode Uses

func (c *IntCoder) Encode() ([]byte, error)

type IntsCoder Uses

type IntsCoder struct {
    // contains filtered or unexported fields
}

func Ints Uses

func Ints(v []int) *IntsCoder

func IntsPtr Uses

func IntsPtr(v *[]int) *IntsCoder

func (*IntsCoder) Decode Uses

func (c *IntsCoder) Decode(content []byte) error

func (*IntsCoder) Encode Uses

func (c *IntsCoder) Encode() ([]byte, error)

type LLCConfig Uses

type LLCConfig struct {
    Servers        *[]string
    Tags           *map[string]*TagConfig `yaml:"tags"`
    CacheControl   *CacheControlConfig    `yaml:"cache_control"`
    Expiration     *time.Duration         `yaml:"expiration"`
    LockExpiration *time.Duration         `yaml:"lock_expiration"`
}

func (*LLCConfig) Options Uses

func (cfg *LLCConfig) Options() []OptionFunc

type LTCondition Uses

type LTCondition struct {
    // contains filtered or unexported fields
}

func (*LTCondition) Build Uses

func (c *LTCondition) Build(factory *ValueFactory)

func (*LTCondition) Column Uses

func (c *LTCondition) Column() string

func (*LTCondition) Compare Uses

func (c *LTCondition) Compare(value *Value) bool

func (*LTCondition) Query Uses

func (c *LTCondition) Query() string

func (*LTCondition) QueryArgs Uses

func (c *LTCondition) QueryArgs() []interface{}

func (*LTCondition) Release Uses

func (c *LTCondition) Release()

func (*LTCondition) Search Uses

func (c *LTCondition) Search(tree *BTree) []Leaf

func (*LTCondition) Value Uses

func (c *LTCondition) Value() *Value

type LTECondition Uses

type LTECondition struct {
    // contains filtered or unexported fields
}

func (*LTECondition) Build Uses

func (c *LTECondition) Build(factory *ValueFactory)

func (*LTECondition) Column Uses

func (c *LTECondition) Column() string

func (*LTECondition) Compare Uses

func (c *LTECondition) Compare(value *Value) bool

func (*LTECondition) Query Uses

func (c *LTECondition) Query() string

func (*LTECondition) QueryArgs Uses

func (c *LTECondition) QueryArgs() []interface{}

func (*LTECondition) Release Uses

func (c *LTECondition) Release()

func (*LTECondition) Search Uses

func (c *LTECondition) Search(tree *BTree) []Leaf

func (*LTECondition) Value Uses

func (c *LTECondition) Value() *Value

type LastLevelCache Uses

type LastLevelCache struct {
    // contains filtered or unexported fields
}

func NewLastLevelCache Uses

func NewLastLevelCache(cacheServer server.CacheServer, opt *LastLevelCacheOption) *LastLevelCache

func (*LastLevelCache) Create Uses

func (c *LastLevelCache) Create(tx *Tx, tag, key string, value Type, expiration time.Duration) error

func (*LastLevelCache) Delete Uses

func (c *LastLevelCache) Delete(tx *Tx, tag, key string) error

func (*LastLevelCache) Find Uses

func (c *LastLevelCache) Find(tx *Tx, tag, key string, value Type) error

func (*LastLevelCache) Update Uses

func (c *LastLevelCache) Update(tx *Tx, tag, key string, value Type, expiration time.Duration) error

type LastLevelCacheOption Uses

type LastLevelCacheOption struct {
    // contains filtered or unexported fields
}

type Leaf Uses

type Leaf interface {
}

type LockingReadOption Uses

type LockingReadOption struct {
    // contains filtered or unexported fields
}

func (*LockingReadOption) String Uses

func (o *LockingReadOption) String() string

type LogEncoder Uses

type LogEncoder interface {
    EncodeLog() string
}

type LogMap Uses

type LogMap map[string]interface{}

func (LogMap) EncodeLog Uses

func (m LogMap) EncodeLog() string

type LogModeType Uses

type LogModeType int
const (
    LogModeConsole LogModeType = iota
    LogModeJSON
    LogModeServerDebug
)

type LogString Uses

type LogString string

func (LogString) EncodeLog Uses

func (s LogString) EncodeLog() string

type LogStrings Uses

type LogStrings []server.CacheKey

func (LogStrings) EncodeLog Uses

func (l LogStrings) EncodeLog() string

type Logger Uses

type Logger interface {
    Warn(msg string)
    Add(string, server.CacheKey, LogEncoder)
    Get(string, SLCType, server.CacheKey, LogEncoder)
    GetFromDB(string, string, interface{}, LogEncoder)
    GetMulti(string, SLCType, []server.CacheKey, LogEncoder)
    Set(string, SLCType, server.CacheKey, LogEncoder)
    InsertIntoDB(string, string, interface{}, LogEncoder)
    Update(string, SLCType, server.CacheKey, LogEncoder)
    UpdateForDB(string, string, interface{}, LogEncoder)
    Delete(string, SLCType, server.CacheKey)
    DeleteFromDB(string, string)
}

type LoggerConfig Uses

type LoggerConfig struct {
    Mode    *string `yaml:"mode"`
    Enabled *bool   `yaml:"enabled"`
}

func (*LoggerConfig) Options Uses

func (cfg *LoggerConfig) Options() []OptionFunc

type Marshaler Uses

type Marshaler interface {
    EncodeRapidash(Encoder) error
}

type NEQCondition Uses

type NEQCondition struct {
    // contains filtered or unexported fields
}

func (*NEQCondition) Build Uses

func (c *NEQCondition) Build(factory *ValueFactory)

func (*NEQCondition) Column Uses

func (c *NEQCondition) Column() string

func (*NEQCondition) Compare Uses

func (c *NEQCondition) Compare(value *Value) bool

func (*NEQCondition) Query Uses

func (c *NEQCondition) Query() string

func (*NEQCondition) QueryArgs Uses

func (c *NEQCondition) QueryArgs() []interface{}

func (*NEQCondition) Release Uses

func (c *NEQCondition) Release()

func (*NEQCondition) Search Uses

func (c *NEQCondition) Search(tree *BTree) []Leaf

func (*NEQCondition) Value Uses

func (c *NEQCondition) Value() *Value

type Node Uses

type Node struct {
    // contains filtered or unexported fields
}

func NewNode Uses

func NewNode() *Node

type NopLogger Uses

type NopLogger struct{}

func (*NopLogger) Add Uses

func (*NopLogger) Add(id string, key server.CacheKey, value LogEncoder)

func (*NopLogger) Delete Uses

func (*NopLogger) Delete(id string, typ SLCType, key server.CacheKey)

func (*NopLogger) DeleteFromDB Uses

func (*NopLogger) DeleteFromDB(id, sql string)

func (*NopLogger) Get Uses

func (*NopLogger) Get(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*NopLogger) GetFromDB Uses

func (*NopLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)

func (*NopLogger) GetMulti Uses

func (*NopLogger) GetMulti(id string, typ SLCType, key []server.CacheKey, value LogEncoder)

func (*NopLogger) InsertIntoDB Uses

func (*NopLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)

func (*NopLogger) Set Uses

func (*NopLogger) Set(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*NopLogger) Update Uses

func (*NopLogger) Update(id string, typ SLCType, key server.CacheKey, value LogEncoder)

func (*NopLogger) UpdateForDB Uses

func (*NopLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)

func (*NopLogger) Warn Uses

func (*NopLogger) Warn(msg string)

type Option Uses

type Option struct {
    // contains filtered or unexported fields
}

type OptionFunc Uses

type OptionFunc func(*Rapidash)

func LastLevelCacheExpiration Uses

func LastLevelCacheExpiration(expiration time.Duration) OptionFunc

func LastLevelCacheLockExpiration Uses

func LastLevelCacheLockExpiration(expiration time.Duration) OptionFunc

func LastLevelCacheOptimisticLock Uses

func LastLevelCacheOptimisticLock(enabled bool) OptionFunc

func LastLevelCachePessimisticLock Uses

func LastLevelCachePessimisticLock(enabled bool) OptionFunc

func LastLevelCacheServerAddrs Uses

func LastLevelCacheServerAddrs(addrs []string) OptionFunc

func LastLevelCacheTagExpiration Uses

func LastLevelCacheTagExpiration(tag string, expiration time.Duration) OptionFunc

func LastLevelCacheTagIgnoreStash Uses

func LastLevelCacheTagIgnoreStash(tag string) OptionFunc

func LastLevelCacheTagLockExpiration Uses

func LastLevelCacheTagLockExpiration(tag string, expiration time.Duration) OptionFunc

func LastLevelCacheTagOptimisticLock Uses

func LastLevelCacheTagOptimisticLock(tag string, enabled bool) OptionFunc

func LastLevelCacheTagPessimisticLock Uses

func LastLevelCacheTagPessimisticLock(tag string, enabled bool) OptionFunc

func LastLevelCacheTagServerAddr Uses

func LastLevelCacheTagServerAddr(tag string, serverAddr string) OptionFunc

func LogEnabled Uses

func LogEnabled(enabled bool) OptionFunc

func LogMode Uses

func LogMode(mode LogModeType) OptionFunc

func LogServerAddr Uses

func LogServerAddr(addr string) OptionFunc

func MaxIdleConnections Uses

func MaxIdleConnections(cons int) OptionFunc

func MaxRetryCount Uses

func MaxRetryCount(cnt int) OptionFunc

func RetryInterval Uses

func RetryInterval(interval time.Duration) OptionFunc

func SecondLevelCacheExpiration Uses

func SecondLevelCacheExpiration(expiration time.Duration) OptionFunc

func SecondLevelCacheLockExpiration Uses

func SecondLevelCacheLockExpiration(expiration time.Duration) OptionFunc

func SecondLevelCacheOptimisticLock Uses

func SecondLevelCacheOptimisticLock(enabled bool) OptionFunc

func SecondLevelCachePessimisticLock Uses

func SecondLevelCachePessimisticLock(enabled bool) OptionFunc

func SecondLevelCacheServerAddrs Uses

func SecondLevelCacheServerAddrs(addrs []string) OptionFunc

func SecondLevelCacheTableExpiration Uses

func SecondLevelCacheTableExpiration(table string, expiration time.Duration) OptionFunc

func SecondLevelCacheTableLockExpiration Uses

func SecondLevelCacheTableLockExpiration(table string, expiration time.Duration) OptionFunc

func SecondLevelCacheTableOptimisticLock Uses

func SecondLevelCacheTableOptimisticLock(table string, enabled bool) OptionFunc

func SecondLevelCacheTablePessimisticLock Uses

func SecondLevelCacheTablePessimisticLock(table string, enabled bool) OptionFunc

func SecondLevelCacheTableServerAddr Uses

func SecondLevelCacheTableServerAddr(table string, serverAddr string) OptionFunc

func SecondLevelCacheTableShardKey Uses

func SecondLevelCacheTableShardKey(table string, shardKey string) OptionFunc

func ServerAddrs Uses

func ServerAddrs(addrs []string) OptionFunc

func ServerType Uses

func ServerType(typ CacheServerType) OptionFunc

func Timeout Uses

func Timeout(timeout time.Duration) OptionFunc

type OrderCondition Uses

type OrderCondition struct {
    // contains filtered or unexported fields
}

type PendingQuery Uses

type PendingQuery struct {
    *QueryLog
    // contains filtered or unexported fields
}

type PrimaryKeyDecoder Uses

type PrimaryKeyDecoder struct {
    // contains filtered or unexported fields
}

func NewPrimaryKeyDecoder Uses

func NewPrimaryKeyDecoder(buf *bytes.Buffer) *PrimaryKeyDecoder

func (*PrimaryKeyDecoder) Decode Uses

func (d *PrimaryKeyDecoder) Decode() (string, error)

func (*PrimaryKeyDecoder) SetBuffer Uses

func (d *PrimaryKeyDecoder) SetBuffer(content []byte)

type Queries Uses

type Queries struct {
    // contains filtered or unexported fields
}

func NewQueries Uses

func NewQueries(tableName string, primaryIndex *Index, queryNum int) *Queries

func (*Queries) Add Uses

func (q *Queries) Add(query *Query)

func (*Queries) At Uses

func (q *Queries) At(idx int) *Query

func (*Queries) CacheMissQueries Uses

func (q *Queries) CacheMissQueries() []*Query

func (*Queries) CacheMissQueriesToSQL Uses

func (q *Queries) CacheMissQueriesToSQL(typ *Struct) (string, []interface{})

func (*Queries) Each Uses

func (q *Queries) Each(iter func(*Query) error) error

func (*Queries) FindCacheMissQueryByStructValue Uses

func (q *Queries) FindCacheMissQueryByStructValue(value *StructValue) *Query

func (*Queries) Len Uses

func (q *Queries) Len() int

func (*Queries) LoadValues Uses

func (q *Queries) LoadValues(factory *ValueFactory, primaryKeyLoader func(IndexType, *QueryIterator) error, valueLoader func(*ValueIterator) error) (*StructSliceValue, error)

type Query Uses

type Query struct {
    // contains filtered or unexported fields
}

func NewQuery Uses

func NewQuery(columnNum int) *Query

func (*Query) Add Uses

func (q *Query) Add(condition Condition)

func (*Query) Field Uses

func (q *Query) Field(column string) *Value

func (*Query) Index Uses

func (q *Query) Index() *Index

func (*Query) SetIndex Uses

func (q *Query) SetIndex(index *Index) error

type QueryBuilder Uses

type QueryBuilder struct {
    // contains filtered or unexported fields
}

func NewQueryBuilder Uses

func NewQueryBuilder(tableName string) *QueryBuilder

func (*QueryBuilder) AvailableCache Uses

func (b *QueryBuilder) AvailableCache() bool

func (*QueryBuilder) AvailableIndex Uses

func (b *QueryBuilder) AvailableIndex() bool

func (*QueryBuilder) Build Uses

func (b *QueryBuilder) Build(factory *ValueFactory)

func (*QueryBuilder) BuildWithIndex Uses

func (b *QueryBuilder) BuildWithIndex(factory *ValueFactory, indexes map[string]*Index, typ *Struct) (*Queries, error)

func (*QueryBuilder) Conditions Uses

func (b *QueryBuilder) Conditions() *Conditions

func (*QueryBuilder) DeleteSQL Uses

func (b *QueryBuilder) DeleteSQL() (string, []interface{})

func (*QueryBuilder) Eq Uses

func (b *QueryBuilder) Eq(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) Fields Uses

func (b *QueryBuilder) Fields() map[string]*Value

func (*QueryBuilder) ForUpdate Uses

func (b *QueryBuilder) ForUpdate() *QueryBuilder

func (*QueryBuilder) Gt Uses

func (b *QueryBuilder) Gt(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) Gte Uses

func (b *QueryBuilder) Gte(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) In Uses

func (b *QueryBuilder) In(column string, values interface{}) *QueryBuilder

func (*QueryBuilder) Index Uses

func (b *QueryBuilder) Index() string

func (*QueryBuilder) IsUnsupportedCacheQuery Uses

func (b *QueryBuilder) IsUnsupportedCacheQuery() bool

func (*QueryBuilder) LockInShareMode Uses

func (b *QueryBuilder) LockInShareMode() *QueryBuilder

func (*QueryBuilder) Lt Uses

func (b *QueryBuilder) Lt(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) Lte Uses

func (b *QueryBuilder) Lte(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) Neq Uses

func (b *QueryBuilder) Neq(column string, value interface{}) *QueryBuilder

func (*QueryBuilder) OrderAsc Uses

func (b *QueryBuilder) OrderAsc(column string) *QueryBuilder

func (*QueryBuilder) OrderBy Uses

func (b *QueryBuilder) OrderBy(column string) *QueryBuilder

func (*QueryBuilder) OrderDesc Uses

func (b *QueryBuilder) OrderDesc(column string) *QueryBuilder

func (*QueryBuilder) Query Uses

func (b *QueryBuilder) Query() string

func (*QueryBuilder) Release Uses

func (b *QueryBuilder) Release()

func (*QueryBuilder) SQL Uses

func (b *QueryBuilder) SQL(stmt string, values ...interface{}) *QueryBuilder

func (*QueryBuilder) SelectSQL Uses

func (b *QueryBuilder) SelectSQL(typ *Struct) (string, []interface{})

func (*QueryBuilder) UpdateSQL Uses

func (b *QueryBuilder) UpdateSQL(updateMap map[string]interface{}) (string, []interface{})

type QueryIterator Uses

type QueryIterator struct {
    // contains filtered or unexported fields
}

func NewQueryIterator Uses

func NewQueryIterator(queries []*Query) *QueryIterator

func (*QueryIterator) Error Uses

func (i *QueryIterator) Error() error

func (*QueryIterator) Key Uses

func (i *QueryIterator) Key() server.CacheKey

func (*QueryIterator) Next Uses

func (i *QueryIterator) Next() bool

func (*QueryIterator) PrimaryKeys Uses

func (i *QueryIterator) PrimaryKeys() []server.CacheKey

func (*QueryIterator) Query Uses

func (i *QueryIterator) Query() *Query

func (*QueryIterator) QueryByPrimaryKey Uses

func (i *QueryIterator) QueryByPrimaryKey(primaryKey server.CacheKey) *Query

func (*QueryIterator) Reset Uses

func (i *QueryIterator) Reset()

func (*QueryIterator) SetError Uses

func (i *QueryIterator) SetError(err error)

func (*QueryIterator) SetErrorWithKey Uses

func (i *QueryIterator) SetErrorWithKey(key server.CacheKey, err error)

func (*QueryIterator) SetPrimaryKey Uses

func (i *QueryIterator) SetPrimaryKey(primaryKey server.CacheKey)

func (*QueryIterator) SetPrimaryKeyWithKey Uses

func (i *QueryIterator) SetPrimaryKeyWithKey(key, primaryKey server.CacheKey)

func (*QueryIterator) SetPrimaryKeys Uses

func (i *QueryIterator) SetPrimaryKeys(primaryKeys []server.CacheKey)

func (*QueryIterator) SetPrimaryKeysWithKey Uses

func (i *QueryIterator) SetPrimaryKeysWithKey(key server.CacheKey, primaryKeys []server.CacheKey)

type QueryLog Uses

type QueryLog struct {
    Command string              `json:"command"`
    Key     string              `json:"key"`
    Hash    uint32              `json:"hash"`
    Type    server.CacheKeyType `json:"type"`
    Addr    string              `json:"addr"`
}

type QueryResult Uses

type QueryResult struct {
    // contains filtered or unexported fields
}

type Rapidash Uses

type Rapidash struct {
    // contains filtered or unexported fields
}

func New Uses

func New(opts ...OptionFunc) (*Rapidash, error)

func (*Rapidash) AddLastLevelCacheServer Uses

func (r *Rapidash) AddLastLevelCacheServer(servers ...string) error

func (*Rapidash) AddSecondLevelCacheServer Uses

func (r *Rapidash) AddSecondLevelCacheServer(servers ...string) error

func (*Rapidash) AddServers Uses

func (r *Rapidash) AddServers(servers ...string) error

func (*Rapidash) AfterCommitCallback Uses

func (r *Rapidash) AfterCommitCallback(
    successCallback func(*Tx) error,
    failureCallback func(*Tx, []*QueryLog) error)

func (*Rapidash) BeforeCommitCallback Uses

func (r *Rapidash) BeforeCommitCallback(callback func(*Tx, []*QueryLog) error)

func (*Rapidash) Begin Uses

func (r *Rapidash) Begin(conns ...Connection) (*Tx, error)

func (*Rapidash) Flush Uses

func (r *Rapidash) Flush() error

func (*Rapidash) Ignore Uses

func (r *Rapidash) Ignore(conn *sql.DB, typ *Struct) error

Ignore read/write to database without cache access

func (*Rapidash) Recover Uses

func (r *Rapidash) Recover(queries []*QueryLog) error

func (*Rapidash) RemoveLastLevelCacheServers Uses

func (r *Rapidash) RemoveLastLevelCacheServers(servers ...string) error

func (*Rapidash) RemoveSecondLevelCacheServers Uses

func (r *Rapidash) RemoveSecondLevelCacheServers(servers ...string) error

func (*Rapidash) RemoveServers Uses

func (r *Rapidash) RemoveServers(servers ...string) error

func (*Rapidash) WarmUp Uses

func (r *Rapidash) WarmUp(conn *sql.DB, typ *Struct, isReadOnly bool) error

func (*Rapidash) WarmUpFirstLevelCache Uses

func (r *Rapidash) WarmUpFirstLevelCache(conn *sql.DB, typ *Struct) error

func (*Rapidash) WarmUpSecondLevelCache Uses

func (r *Rapidash) WarmUpSecondLevelCache(conn *sql.DB, typ *Struct) error

type RetryConfig Uses

type RetryConfig struct {
    Limit    *int           `yaml:"limit"`
    Interval *time.Duration `yaml:"interval"`
}

func (*RetryConfig) Options Uses

func (cfg *RetryConfig) Options() []OptionFunc

type RuleConfig Uses

type RuleConfig struct {
    Servers           *[]string           `yaml:"servers"`
    Logger            *LoggerConfig       `yaml:"logger"`
    Retry             *RetryConfig        `yaml:"retry"`
    CacheControl      *CacheControlConfig `yaml:"cache_control"`
    Timeout           *int                `yaml:"timeout"`
    MaxIdleConnection *int                `yaml:"max_idle_connection"`
}

func (*RuleConfig) Options Uses

func (cfg *RuleConfig) Options() []OptionFunc

type SLCCommandType Uses

type SLCCommandType string
const (
    SLCCommandGet      SLCCommandType = "get"
    SLCCommandSet      SLCCommandType = "set"
    SLCCommandGetMulti SLCCommandType = "get_multi"
    SLCCommandUpdate   SLCCommandType = "update"
    SLCCommandDelete   SLCCommandType = "delete"
    SLCCommandAdd      SLCCommandType = "add"
)

type SLCConfig Uses

type SLCConfig struct {
    Servers        *[]string                `yaml:"servers"`
    Tables         *map[string]*TableConfig `yaml:"tables"`
    Expiration     *time.Duration           `yaml:"expiration"`
    LockExpiration *time.Duration           `yaml:"lock_expiration"`
}

func (*SLCConfig) Options Uses

func (cfg *SLCConfig) Options() []OptionFunc

type SLCType Uses

type SLCType string
const (
    SLCServer SLCType = "server"
    SLCStash  SLCType = "stash"
    SLCDB     SLCType = "db"
)

type SQLCondition Uses

type SQLCondition struct {
    // contains filtered or unexported fields
}

func (*SQLCondition) Build Uses

func (c *SQLCondition) Build(factory *ValueFactory)

func (*SQLCondition) Release Uses

func (c *SQLCondition) Release()

type SecondLevelCache Uses

type SecondLevelCache struct {
    // contains filtered or unexported fields
}

func NewSecondLevelCache Uses

func NewSecondLevelCache(s *Struct, server server.CacheServer, opt TableOption) *SecondLevelCache

func (*SecondLevelCache) CountByQueryBuilder Uses

func (c *SecondLevelCache) CountByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) (uint64, error)

func (*SecondLevelCache) Create Uses

func (c *SecondLevelCache) Create(ctx context.Context, tx *Tx, marshaler Marshaler) (id int64, e error)

func (*SecondLevelCache) CreateWithoutCache Uses

func (c *SecondLevelCache) CreateWithoutCache(ctx context.Context, tx *Tx, marshaler Marshaler) (id int64, e error)

func (*SecondLevelCache) DeleteByPrimaryKey Uses

func (c *SecondLevelCache) DeleteByPrimaryKey(tx *Tx, v *Value) error

func (*SecondLevelCache) DeleteByQueryBuilder Uses

func (c *SecondLevelCache) DeleteByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) error

func (*SecondLevelCache) FindByQueryBuilder Uses

func (c *SecondLevelCache) FindByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, unmarshaler Unmarshaler) error

func (*SecondLevelCache) UpdateByPrimaryKey Uses

func (c *SecondLevelCache) UpdateByPrimaryKey(tx *Tx, marshaler Marshaler) error

func (*SecondLevelCache) UpdateByQueryBuilder Uses

func (c *SecondLevelCache) UpdateByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, updateMap map[string]interface{}) (e error)

func (*SecondLevelCache) WarmUp Uses

func (c *SecondLevelCache) WarmUp(conn *sql.DB) error

type SecondLevelCacheMap Uses

type SecondLevelCacheMap struct {
    *sync.Map
}

func NewSecondLevelCacheMap Uses

func NewSecondLevelCacheMap() *SecondLevelCacheMap

type Selectors Uses

type Selectors struct {
    // contains filtered or unexported fields
}

type Stash Uses

type Stash struct {
    // contains filtered or unexported fields
}

func NewStash Uses

func NewStash() *Stash

type StringCoder Uses

type StringCoder struct {
    // contains filtered or unexported fields
}

func String Uses

func String(v string) *StringCoder

func StringPtr Uses

func StringPtr(v *string) *StringCoder

func (*StringCoder) Decode Uses

func (c *StringCoder) Decode(content []byte) error

func (*StringCoder) Encode Uses

func (c *StringCoder) Encode() ([]byte, error)

type StringsCoder Uses

type StringsCoder struct {
    // contains filtered or unexported fields
}

func Strings Uses

func Strings(v []string) *StringsCoder

func StringsPtr Uses

func StringsPtr(v *[]string) *StringsCoder

func (*StringsCoder) Decode Uses

func (c *StringsCoder) Decode(content []byte) error

func (*StringsCoder) Encode Uses

func (c *StringsCoder) Encode() ([]byte, error)

type Struct Uses

type Struct struct {
    // contains filtered or unexported fields
}

func NewStruct Uses

func NewStruct(tableName string) *Struct

func (*Struct) Cast Uses

func (s *Struct) Cast(coder Coder) Type

func (*Struct) Columns Uses

func (s *Struct) Columns() []string

func (*Struct) FieldBool Uses

func (s *Struct) FieldBool(column string) *Struct

func (*Struct) FieldBytes Uses

func (s *Struct) FieldBytes(column string) *Struct

func (*Struct) FieldFloat32 Uses

func (s *Struct) FieldFloat32(column string) *Struct

func (*Struct) FieldFloat64 Uses

func (s *Struct) FieldFloat64(column string) *Struct

func (*Struct) FieldInt Uses

func (s *Struct) FieldInt(column string) *Struct

func (*Struct) FieldInt16 Uses

func (s *Struct) FieldInt16(column string) *Struct

func (*Struct) FieldInt32 Uses

func (s *Struct) FieldInt32(column string) *Struct

func (*Struct) FieldInt64 Uses

func (s *Struct) FieldInt64(column string) *Struct

func (*Struct) FieldInt8 Uses

func (s *Struct) FieldInt8(column string) *Struct

func (*Struct) FieldSelfStruct Uses

func (s *Struct) FieldSelfStruct(column string) *Struct

func (*Struct) FieldSelfStructSlice Uses

func (s *Struct) FieldSelfStructSlice(column string) *Struct

func (*Struct) FieldSlice Uses

func (s *Struct) FieldSlice(column string, typ TypeID) *Struct

func (*Struct) FieldString Uses

func (s *Struct) FieldString(column string) *Struct

func (*Struct) FieldStruct Uses

func (s *Struct) FieldStruct(column string, structType *Struct) *Struct

func (*Struct) FieldStructSlice Uses

func (s *Struct) FieldStructSlice(column string, structType *Struct) *Struct

func (*Struct) FieldTime Uses

func (s *Struct) FieldTime(column string) *Struct

func (*Struct) FieldUint Uses

func (s *Struct) FieldUint(column string) *Struct

func (*Struct) FieldUint16 Uses

func (s *Struct) FieldUint16(column string) *Struct

func (*Struct) FieldUint32 Uses

func (s *Struct) FieldUint32(column string) *Struct

func (*Struct) FieldUint64 Uses

func (s *Struct) FieldUint64(column string) *Struct

func (*Struct) FieldUint8 Uses

func (s *Struct) FieldUint8(column string) *Struct

func (*Struct) ScanValues Uses

func (s *Struct) ScanValues(factory *ValueFactory) []interface{}

func (*Struct) StructValue Uses

func (s *Struct) StructValue(values []interface{}) *StructValue

type StructCoder Uses

type StructCoder struct {
    // contains filtered or unexported fields
}

func (*StructCoder) Decode Uses

func (c *StructCoder) Decode(content []byte) error

func (*StructCoder) Encode Uses

func (c *StructCoder) Encode() ([]byte, error)

type StructEncoder Uses

type StructEncoder struct {
    // contains filtered or unexported fields
}

func NewStructEncoder Uses

func NewStructEncoder(s *Struct, factory *ValueFactory) *StructEncoder

func (*StructEncoder) Bool Uses

func (e *StructEncoder) Bool(column string, v bool)

func (*StructEncoder) BoolPtr Uses

func (e *StructEncoder) BoolPtr(column string, v *bool)

func (*StructEncoder) Bools Uses

func (e *StructEncoder) Bools(column string, v []bool)

func (*StructEncoder) Bytes Uses

func (e *StructEncoder) Bytes(column string, v []byte)

func (*StructEncoder) BytesPtr Uses

func (e *StructEncoder) BytesPtr(column string, v *[]byte)

func (*StructEncoder) Encode Uses

func (e *StructEncoder) Encode() ([]byte, error)

func (*StructEncoder) EncodeSlice Uses

func (e *StructEncoder) EncodeSlice() ([][]byte, error)

func (*StructEncoder) Error Uses

func (e *StructEncoder) Error() error

func (*StructEncoder) Float32 Uses

func (e *StructEncoder) Float32(column string, v float32)

func (*StructEncoder) Float32Ptr Uses

func (e *StructEncoder) Float32Ptr(column string, v *float32)

func (*StructEncoder) Float32s Uses

func (e *StructEncoder) Float32s(column string, v []float32)

func (*StructEncoder) Float64 Uses

func (e *StructEncoder) Float64(column string, v float64)

func (*StructEncoder) Float64Ptr Uses

func (e *StructEncoder) Float64Ptr(column string, v *float64)

func (*StructEncoder) Float64s Uses

func (e *StructEncoder) Float64s(column string, v []float64)

func (*StructEncoder) Int Uses

func (e *StructEncoder) Int(column string, v int)

func (*StructEncoder) Int16 Uses

func (e *StructEncoder) Int16(column string, v int16)

func (*StructEncoder) Int16Ptr Uses

func (e *StructEncoder) Int16Ptr(column string, v *int16)

func (*StructEncoder) Int16s Uses

func (e *StructEncoder) Int16s(column string, v []int16)

func (*StructEncoder) Int32 Uses

func (e *StructEncoder) Int32(column string, v int32)

func (*StructEncoder) Int32Ptr Uses

func (e *StructEncoder) Int32Ptr(column string, v *int32)

func (*StructEncoder) Int32s Uses

func (e *StructEncoder) Int32s(column string, v []int32)

func (*StructEncoder) Int64 Uses

func (e *StructEncoder) Int64(column string, v int64)

func (*StructEncoder) Int64Ptr Uses

func (e *StructEncoder) Int64Ptr(column string, v *int64)

func (*StructEncoder) Int64s Uses

func (e *StructEncoder) Int64s(column string, v []int64)

func (*StructEncoder) Int8 Uses

func (e *StructEncoder) Int8(column string, v int8)

func (*StructEncoder) Int8Ptr Uses

func (e *StructEncoder) Int8Ptr(column string, v *int8)

func (*StructEncoder) Int8s Uses

func (e *StructEncoder) Int8s(column string, v []int8)

func (*StructEncoder) IntPtr Uses

func (e *StructEncoder) IntPtr(column string, v *int)

func (*StructEncoder) Ints Uses

func (e *StructEncoder) Ints(column string, v []int)

func (*StructEncoder) New Uses

func (e *StructEncoder) New() Encoder

func (*StructEncoder) String Uses

func (e *StructEncoder) String(column string, v string)

func (*StructEncoder) StringPtr Uses

func (e *StructEncoder) StringPtr(column string, v *string)

func (*StructEncoder) Strings Uses

func (e *StructEncoder) Strings(column string, v []string)

func (*StructEncoder) Struct Uses

func (e *StructEncoder) Struct(column string, v Marshaler)

func (*StructEncoder) Structs Uses

func (e *StructEncoder) Structs(column string, v Marshaler)

func (*StructEncoder) Time Uses

func (e *StructEncoder) Time(column string, v time.Time)

func (*StructEncoder) TimePtr Uses

func (e *StructEncoder) TimePtr(column string, v *time.Time)

func (*StructEncoder) Times Uses

func (e *StructEncoder) Times(column string, v []time.Time)

func (*StructEncoder) Uint Uses

func (e *StructEncoder) Uint(column string, v uint)

func (*StructEncoder) Uint16 Uses

func (e *StructEncoder) Uint16(column string, v uint16)

func (*StructEncoder) Uint16Ptr Uses

func (e *StructEncoder) Uint16Ptr(column string, v *uint16)

func (*StructEncoder) Uint16s Uses

func (e *StructEncoder) Uint16s(column string, v []uint16)

func (*StructEncoder) Uint32 Uses

func (e *StructEncoder) Uint32(column string, v uint32)

func (*StructEncoder) Uint32Ptr Uses

func (e *StructEncoder) Uint32Ptr(column string, v *uint32)

func (*StructEncoder) Uint32s Uses

func (e *StructEncoder) Uint32s(column string, v []uint32)

func (*StructEncoder) Uint64 Uses

func (e *StructEncoder) Uint64(column string, v uint64)

func (*StructEncoder) Uint64Ptr Uses

func (e *StructEncoder) Uint64Ptr(column string, v *uint64)

func (*StructEncoder) Uint64s Uses

func (e *StructEncoder) Uint64s(column string, v []uint64)

func (*StructEncoder) Uint8 Uses

func (e *StructEncoder) Uint8(column string, v uint8)

func (*StructEncoder) Uint8Ptr Uses

func (e *StructEncoder) Uint8Ptr(column string, v *uint8)

func (*StructEncoder) Uint8s Uses

func (e *StructEncoder) Uint8s(column string, v []uint8)

func (*StructEncoder) UintPtr Uses

func (e *StructEncoder) UintPtr(column string, v *uint)

func (*StructEncoder) Uints Uses

func (e *StructEncoder) Uints(column string, v []uint)

type StructField Uses

type StructField struct {
    // contains filtered or unexported fields
}

func (*StructField) ScanValue Uses

func (sf *StructField) ScanValue(factory *ValueFactory) *Value

type StructSliceEncoder Uses

type StructSliceEncoder struct {
    *StructEncoder
    // contains filtered or unexported fields
}

func NewStructSliceEncoder Uses

func NewStructSliceEncoder(typ *Struct, valueFactory *ValueFactory, coder Coder) *StructSliceEncoder

func (*StructSliceEncoder) Encode Uses

func (e *StructSliceEncoder) Encode() ([]byte, error)

type StructSliceValue Uses

type StructSliceValue struct {
    // contains filtered or unexported fields
}

func NewStructSliceValue Uses

func NewStructSliceValue() *StructSliceValue

func (*StructSliceValue) Append Uses

func (v *StructSliceValue) Append(value *StructValue)

func (*StructSliceValue) AppendSlice Uses

func (v *StructSliceValue) AppendSlice(slice *StructSliceValue)

func (*StructSliceValue) At Uses

func (v *StructSliceValue) At(idx int) Decoder

func (*StructSliceValue) Bool Uses

func (v *StructSliceValue) Bool(column string) bool

func (*StructSliceValue) BoolPtr Uses

func (v *StructSliceValue) BoolPtr(column string) *bool

func (*StructSliceValue) Bools Uses

func (v *StructSliceValue) Bools(column string) []bool

func (*StructSliceValue) Bytes Uses

func (v *StructSliceValue) Bytes(column string) []byte

func (*StructSliceValue) BytesPtr Uses

func (v *StructSliceValue) BytesPtr(column string) *[]byte

func (*StructSliceValue) EncodeLog Uses

func (v *StructSliceValue) EncodeLog() string

func (*StructSliceValue) Error Uses

func (v *StructSliceValue) Error() error

func (*StructSliceValue) Filter Uses

func (v *StructSliceValue) Filter(condition Condition) *StructSliceValue

func (*StructSliceValue) Float32 Uses

func (v *StructSliceValue) Float32(column string) float32

func (*StructSliceValue) Float32Ptr Uses

func (v *StructSliceValue) Float32Ptr(column string) *float32

func (*StructSliceValue) Float32s Uses

func (v *StructSliceValue) Float32s(column string) []float32

func (*StructSliceValue) Float64 Uses

func (v *StructSliceValue) Float64(column string) float64

func (*StructSliceValue) Float64Ptr Uses

func (v *StructSliceValue) Float64Ptr(column string) *float64

func (*StructSliceValue) Float64s Uses

func (v *StructSliceValue) Float64s(column string) []float64

func (*StructSliceValue) Int Uses

func (v *StructSliceValue) Int(column string) int

func (*StructSliceValue) Int16 Uses

func (v *StructSliceValue) Int16(column string) int16

func (*StructSliceValue) Int16Ptr Uses

func (v *StructSliceValue) Int16Ptr(column string) *int16

func (*StructSliceValue) Int16s Uses

func (v *StructSliceValue) Int16s(column string) []int16

func (*StructSliceValue) Int32 Uses

func (v *StructSliceValue) Int32(column string) int32

func (*StructSliceValue) Int32Ptr Uses

func (v *StructSliceValue) Int32Ptr(column string) *int32

func (*StructSliceValue) Int32s Uses

func (v *StructSliceValue) Int32s(column string) []int32

func (*StructSliceValue) Int64 Uses

func (v *StructSliceValue) Int64(column string) int64

func (*StructSliceValue) Int64Ptr Uses

func (v *StructSliceValue) Int64Ptr(column string) *int64

func (*StructSliceValue) Int64s Uses

func (v *StructSliceValue) Int64s(column string) []int64

func (*StructSliceValue) Int8 Uses

func (v *StructSliceValue) Int8(column string) int8

func (*StructSliceValue) Int8Ptr Uses

func (v *StructSliceValue) Int8Ptr(column string) *int8

func (*StructSliceValue) Int8s Uses

func (v *StructSliceValue) Int8s(column string) []int8

func (*StructSliceValue) IntPtr Uses

func (v *StructSliceValue) IntPtr(column string) *int

func (*StructSliceValue) Ints Uses

func (v *StructSliceValue) Ints(column string) []int

func (*StructSliceValue) Len Uses

func (v *StructSliceValue) Len() int

func (*StructSliceValue) Release Uses

func (v *StructSliceValue) Release()

func (*StructSliceValue) Slice Uses

func (v *StructSliceValue) Slice(column string, unmarshaler Unmarshaler)

func (*StructSliceValue) Sort Uses

func (v *StructSliceValue) Sort(orders []*OrderCondition)

func (*StructSliceValue) String Uses

func (v *StructSliceValue) String(column string) string

func (*StructSliceValue) StringPtr Uses

func (v *StructSliceValue) StringPtr(column string) *string

func (*StructSliceValue) Strings Uses

func (v *StructSliceValue) Strings(column string) []string

func (*StructSliceValue) Struct Uses

func (v *StructSliceValue) Struct(column string, unmarshaler Unmarshaler)

func (*StructSliceValue) Time Uses

func (v *StructSliceValue) Time(column string) time.Time

func (*StructSliceValue) TimePtr Uses

func (v *StructSliceValue) TimePtr(column string) *time.Time

func (*StructSliceValue) Times Uses

func (v *StructSliceValue) Times(column string) []time.Time

func (*StructSliceValue) Uint Uses

func (v *StructSliceValue) Uint(column string) uint

func (*StructSliceValue) Uint16 Uses

func (v *StructSliceValue) Uint16(column string) uint16

func (*StructSliceValue) Uint16Ptr Uses

func (v *StructSliceValue) Uint16Ptr(column string) *uint16

func (*StructSliceValue) Uint16s Uses

func (v *StructSliceValue) Uint16s(column string) []uint16

func (*StructSliceValue) Uint32 Uses

func (v *StructSliceValue) Uint32(column string) uint32

func (*StructSliceValue) Uint32Ptr Uses

func (v *StructSliceValue) Uint32Ptr(column string) *uint32

func (*StructSliceValue) Uint32s Uses

func (v *StructSliceValue) Uint32s(column string) []uint32

func (*StructSliceValue) Uint64 Uses

func (v *StructSliceValue) Uint64(column string) uint64

func (*StructSliceValue) Uint64Ptr Uses

func (v *StructSliceValue) Uint64Ptr(column string) *uint64

func (*StructSliceValue) Uint64s Uses

func (v *StructSliceValue) Uint64s(column string) []uint64

func (*StructSliceValue) Uint8 Uses

func (v *StructSliceValue) Uint8(column string) uint8

func (*StructSliceValue) Uint8Ptr Uses

func (v *StructSliceValue) Uint8Ptr(column string) *uint8

func (*StructSliceValue) Uint8s Uses

func (v *StructSliceValue) Uint8s(column string) []uint8

func (*StructSliceValue) UintPtr Uses

func (v *StructSliceValue) UintPtr(column string) *uint

func (*StructSliceValue) Uints Uses

func (v *StructSliceValue) Uints(column string) []uint

type StructValue Uses

type StructValue struct {
    // contains filtered or unexported fields
}

func (*StructValue) At Uses

func (v *StructValue) At(int) Decoder

func (*StructValue) Bool Uses

func (v *StructValue) Bool(column string) bool

func (*StructValue) BoolPtr Uses

func (v *StructValue) BoolPtr(column string) *bool

func (*StructValue) Bools Uses

func (v *StructValue) Bools(column string) []bool

func (*StructValue) Bytes Uses

func (v *StructValue) Bytes(column string) []byte

func (*StructValue) BytesPtr Uses

func (v *StructValue) BytesPtr(column string) *[]byte

func (*StructValue) EncodeLog Uses

func (v *StructValue) EncodeLog() string

func (*StructValue) Error Uses

func (v *StructValue) Error() error

func (*StructValue) Float32 Uses

func (v *StructValue) Float32(column string) float32

func (*StructValue) Float32Ptr Uses

func (v *StructValue) Float32Ptr(column string) *float32

func (*StructValue) Float32s Uses

func (v *StructValue) Float32s(column string) []float32

func (*StructValue) Float64 Uses

func (v *StructValue) Float64(column string) float64

func (*StructValue) Float64Ptr Uses

func (v *StructValue) Float64Ptr(column string) *float64

func (*StructValue) Float64s Uses

func (v *StructValue) Float64s(column string) []float64

func (*StructValue) Int Uses

func (v *StructValue) Int(column string) int

func (*StructValue) Int16 Uses

func (v *StructValue) Int16(column string) int16

func (*StructValue) Int16Ptr Uses

func (v *StructValue) Int16Ptr(column string) *int16

func (*StructValue) Int16s Uses

func (v *StructValue) Int16s(column string) []int16

func (*StructValue) Int32 Uses

func (v *StructValue) Int32(column string) int32

func (*StructValue) Int32Ptr Uses

func (v *StructValue) Int32Ptr(column string) *int32

func (*StructValue) Int32s Uses

func (v *StructValue) Int32s(column string) []int32

func (*StructValue) Int64 Uses

func (v *StructValue) Int64(column string) int64

func (*StructValue) Int64Ptr Uses

func (v *StructValue) Int64Ptr(column string) *int64

func (*StructValue) Int64s Uses

func (v *StructValue) Int64s(column string) []int64

func (*StructValue) Int8 Uses

func (v *StructValue) Int8(column string) int8

func (*StructValue) Int8Ptr Uses

func (v *StructValue) Int8Ptr(column string) *int8

func (*StructValue) Int8s Uses

func (v *StructValue) Int8s(column string) []int8

func (*StructValue) IntPtr Uses

func (v *StructValue) IntPtr(column string) *int

func (*StructValue) Ints Uses

func (v *StructValue) Ints(column string) []int

func (*StructValue) Len Uses

func (v *StructValue) Len() int

func (*StructValue) Release Uses

func (v *StructValue) Release()

func (*StructValue) Slice Uses

func (v *StructValue) Slice(column string, unmarshaler Unmarshaler)

func (*StructValue) String Uses

func (v *StructValue) String(column string) string

func (*StructValue) StringPtr Uses

func (v *StructValue) StringPtr(column string) *string

func (*StructValue) Strings Uses

func (v *StructValue) Strings(column string) []string

func (*StructValue) Struct Uses

func (v *StructValue) Struct(column string, unmarshaler Unmarshaler)

func (*StructValue) Time Uses

func (v *StructValue) Time(column string) time.Time

func (*StructValue) TimePtr Uses

func (v *StructValue) TimePtr(column string) *time.Time

func (*StructValue) Times Uses

func (v *StructValue) Times(column string) []time.Time

func (*StructValue) Uint Uses

func (v *StructValue) Uint(column string) uint

func (*StructValue) Uint16 Uses

func (v *StructValue) Uint16(column string) uint16

func (*StructValue) Uint16Ptr Uses

func (v *StructValue) Uint16Ptr(column string) *uint16

func (*StructValue) Uint16s Uses

func (v *StructValue) Uint16s(column string) []uint16

func (*StructValue) Uint32 Uses

func (v *StructValue) Uint32(column string) uint32

func (*StructValue) Uint32Ptr Uses

func (v *StructValue) Uint32Ptr(column string) *uint32

func (*StructValue) Uint32s Uses

func (v *StructValue) Uint32s(column string) []uint32

func (*StructValue) Uint64 Uses

func (v *StructValue) Uint64(column string) uint64

func (*StructValue) Uint64Ptr Uses

func (v *StructValue) Uint64Ptr(column string) *uint64

func (*StructValue) Uint64s Uses

func (v *StructValue) Uint64s(column string) []uint64

func (*StructValue) Uint8 Uses

func (v *StructValue) Uint8(column string) uint8

func (*StructValue) Uint8Ptr Uses

func (v *StructValue) Uint8Ptr(column string) *uint8

func (*StructValue) Uint8s Uses

func (v *StructValue) Uint8s(column string) []uint8

func (*StructValue) UintPtr Uses

func (v *StructValue) UintPtr(column string) *uint

func (*StructValue) Uints Uses

func (v *StructValue) Uints(column string) []uint

func (*StructValue) ValueByColumn Uses

func (v *StructValue) ValueByColumn(column string) *Value

type StructsCoder Uses

type StructsCoder struct {
    // contains filtered or unexported fields
}

func Structs Uses

func Structs(v Coder, typ *Struct) *StructsCoder

func StructsPtr Uses

func StructsPtr(v Coder, typ *Struct) *StructsCoder

func (*StructsCoder) Decode Uses

func (c *StructsCoder) Decode(content []byte) error

func (*StructsCoder) Encode Uses

func (c *StructsCoder) Encode() ([]byte, error)

type TableConfig Uses

type TableConfig struct {
    ShardKey       *string             `yaml:"shard_key"`
    Server         *string             `yaml:"server"`
    CacheControl   *CacheControlConfig `yaml:"cache_control"`
    Expiration     *time.Duration      `yaml:"expiration"`
    LockExpiration *time.Duration      `yaml:"lock_expiration"`
}

func (*TableConfig) Options Uses

func (cfg *TableConfig) Options(table string) []OptionFunc

type TableOption Uses

type TableOption struct {
    // contains filtered or unexported fields
}

func (*TableOption) Expiration Uses

func (o *TableOption) Expiration() time.Duration

func (*TableOption) LockExpiration Uses

func (o *TableOption) LockExpiration() time.Duration

func (*TableOption) OptimisticLock Uses

func (o *TableOption) OptimisticLock() bool

func (*TableOption) PessimisticLock Uses

func (o *TableOption) PessimisticLock() bool

func (*TableOption) Server Uses

func (o *TableOption) Server() string

func (*TableOption) ShardKey Uses

func (o *TableOption) ShardKey() string

type TagConfig Uses

type TagConfig struct {
    Server         *string             `yaml:"server"`
    CacheControl   *CacheControlConfig `yaml:"cache_control"`
    Expiration     *time.Duration      `yaml:"expiration"`
    LockExpiration *time.Duration      `yaml:"lock_expiration"`
}

func (*TagConfig) Options Uses

func (cfg *TagConfig) Options(tag string) []OptionFunc

type TagOption Uses

type TagOption struct {
    // contains filtered or unexported fields
}

type TimeCoder Uses

type TimeCoder struct {
    // contains filtered or unexported fields
}

func Time Uses

func Time(v time.Time) *TimeCoder

func TimePtr Uses

func TimePtr(v *time.Time) *TimeCoder

func (*TimeCoder) Decode Uses

func (c *TimeCoder) Decode(content []byte) error

func (*TimeCoder) Encode Uses

func (c *TimeCoder) Encode() ([]byte, error)

type TimesCoder Uses

type TimesCoder struct {
    // contains filtered or unexported fields
}

func Times Uses

func Times(v []time.Time) *TimesCoder

func TimesPtr Uses

func TimesPtr(v *[]time.Time) *TimesCoder

func (*TimesCoder) Decode Uses

func (c *TimesCoder) Decode(content []byte) error

func (*TimesCoder) Encode Uses

func (c *TimesCoder) Encode() ([]byte, error)

type Tx Uses

type Tx struct {
    // contains filtered or unexported fields
}

func (*Tx) AfterCommitCallback Uses

func (tx *Tx) AfterCommitCallback(
    successCallback func() error,
    failureCallback func([]*QueryLog) error)

func (*Tx) BeforeCommitCallback Uses

func (tx *Tx) BeforeCommitCallback(callback func([]*QueryLog) error)

func (*Tx) Commit Uses

func (tx *Tx) Commit() error

func (*Tx) CommitCacheOnly Uses

func (tx *Tx) CommitCacheOnly() error

func (*Tx) CommitDBOnly Uses

func (tx *Tx) CommitDBOnly() error

func (*Tx) CountByQueryBuilder Uses

func (tx *Tx) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)

func (*Tx) CountByQueryBuilderContext Uses

func (tx *Tx) CountByQueryBuilderContext(ctx context.Context, builder *QueryBuilder) (uint64, error)

func (*Tx) Create Uses

func (tx *Tx) Create(key string, value Type) error

func (*Tx) CreateByTable Uses

func (tx *Tx) CreateByTable(tableName string, marshaler Marshaler) (int64, error)

func (*Tx) CreateByTableContext Uses

func (tx *Tx) CreateByTableContext(ctx context.Context, tableName string, marshaler Marshaler) (id int64, e error)

func (*Tx) CreateWithExpiration Uses

func (tx *Tx) CreateWithExpiration(key string, value Type, expiration time.Duration) error

func (*Tx) CreateWithTag Uses

func (tx *Tx) CreateWithTag(tag, key string, value Type) error

func (*Tx) CreateWithTagAndExpiration Uses

func (tx *Tx) CreateWithTagAndExpiration(tag, key string, value Type, expiration time.Duration) error

func (*Tx) Delete Uses

func (tx *Tx) Delete(key string) error

func (*Tx) DeleteByQueryBuilder Uses

func (tx *Tx) DeleteByQueryBuilder(builder *QueryBuilder) error

func (*Tx) DeleteByQueryBuilderContext Uses

func (tx *Tx) DeleteByQueryBuilderContext(ctx context.Context, builder *QueryBuilder) error

func (*Tx) DeleteWithTag Uses

func (tx *Tx) DeleteWithTag(tag, key string) error

func (*Tx) Find Uses

func (tx *Tx) Find(key string, value Type) error

func (*Tx) FindAllByTable Uses

func (tx *Tx) FindAllByTable(tableName string, unmarshaler Unmarshaler) error

func (*Tx) FindByQueryBuilder Uses

func (tx *Tx) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error

func (*Tx) FindByQueryBuilderContext Uses

func (tx *Tx) FindByQueryBuilderContext(ctx context.Context, builder *QueryBuilder, unmarshaler Unmarshaler) error

func (*Tx) FindWithTag Uses

func (tx *Tx) FindWithTag(tag, key string, value Type) error

func (*Tx) ID Uses

func (tx *Tx) ID() string

func (*Tx) IsCommitted Uses

func (tx *Tx) IsCommitted() bool

func (*Tx) Rollback Uses

func (tx *Tx) Rollback() error

func (*Tx) RollbackCacheOnly Uses

func (tx *Tx) RollbackCacheOnly() error

func (*Tx) RollbackCacheOnlyUnlessCommitted Uses

func (tx *Tx) RollbackCacheOnlyUnlessCommitted() error

func (*Tx) RollbackDBOnly Uses

func (tx *Tx) RollbackDBOnly() error

func (*Tx) RollbackDBOnlyUnlessCommitted Uses

func (tx *Tx) RollbackDBOnlyUnlessCommitted() error

func (*Tx) RollbackUnlessCommitted Uses

func (tx *Tx) RollbackUnlessCommitted() error

func (*Tx) Update Uses

func (tx *Tx) Update(key string, value Type) error

func (*Tx) UpdateByQueryBuilder Uses

func (tx *Tx) UpdateByQueryBuilder(builder *QueryBuilder, updateMap map[string]interface{}) error

func (*Tx) UpdateByQueryBuilderContext Uses

func (tx *Tx) UpdateByQueryBuilderContext(ctx context.Context, builder *QueryBuilder, updateMap map[string]interface{}) error

func (*Tx) UpdateWithExpiration Uses

func (tx *Tx) UpdateWithExpiration(key string, value Type, expiration time.Duration) error

func (*Tx) UpdateWithTag Uses

func (tx *Tx) UpdateWithTag(tag, key string, value Type) error

func (*Tx) UpdateWithTagAndExpiration Uses

func (tx *Tx) UpdateWithTagAndExpiration(tag, key string, value Type, expiration time.Duration) error

type TxConnection Uses

type TxConnection interface {
    Connection
    Commit() error
    Rollback() error
}

type TxValue Uses

type TxValue struct {
    // contains filtered or unexported fields
}

func (*TxValue) EncodeLog Uses

func (v *TxValue) EncodeLog() string

func (*TxValue) Marshal Uses

func (v *TxValue) Marshal() ([]byte, error)

func (*TxValue) String Uses

func (v *TxValue) String() string

func (*TxValue) Unmarshal Uses

func (v *TxValue) Unmarshal(content []byte) error

type Type Uses

type Type interface {
    Encode() ([]byte, error)
    Decode([]byte) error
}

type TypeID Uses

type TypeID int
const (
    IntType TypeID = iota
    Int8Type
    Int16Type
    Int32Type
    Int64Type
    UintType
    Uint8Type
    Uint16Type
    Uint32Type
    Uint64Type
    Float32Type
    Float64Type
    BoolType
    StringType
    BytesType
    TimeType
    SliceType
    StructType
)

func (TypeID) String Uses

func (t TypeID) String() string

type TypeKind Uses

type TypeKind int
const (
    IntKind TypeKind = iota
    FloatKind
    BoolKind
    StringKind
    BytesKind
    TimeKind
)

func (TypeKind) String Uses

func (t TypeKind) String() string

type Uint16Coder Uses

type Uint16Coder struct {
    // contains filtered or unexported fields
}

func Uint16 Uses

func Uint16(v uint16) *Uint16Coder

func Uint16Ptr Uses

func Uint16Ptr(v *uint16) *Uint16Coder

func (*Uint16Coder) Decode Uses

func (c *Uint16Coder) Decode(content []byte) error

func (*Uint16Coder) Encode Uses

func (c *Uint16Coder) Encode() ([]byte, error)

type Uint16sCoder Uses

type Uint16sCoder struct {
    // contains filtered or unexported fields
}

func Uint16s Uses

func Uint16s(v []uint16) *Uint16sCoder

func Uint16sPtr Uses

func Uint16sPtr(v *[]uint16) *Uint16sCoder

func (*Uint16sCoder) Decode Uses

func (c *Uint16sCoder) Decode(content []byte) error

func (*Uint16sCoder) Encode Uses

func (c *Uint16sCoder) Encode() ([]byte, error)

type Uint32Coder Uses

type Uint32Coder struct {
    // contains filtered or unexported fields
}

func Uint32 Uses

func Uint32(v uint32) *Uint32Coder

func Uint32Ptr Uses

func Uint32Ptr(v *uint32) *Uint32Coder

func (*Uint32Coder) Decode Uses

func (c *Uint32Coder) Decode(content []byte) error

func (*Uint32Coder) Encode Uses

func (c *Uint32Coder) Encode() ([]byte, error)

type Uint32sCoder Uses

type Uint32sCoder struct {
    // contains filtered or unexported fields
}

func Uint32s Uses

func Uint32s(v []uint32) *Uint32sCoder

func Uint32sPtr Uses

func Uint32sPtr(v *[]uint32) *Uint32sCoder

func (*Uint32sCoder) Decode Uses

func (c *Uint32sCoder) Decode(content []byte) error

func (*Uint32sCoder) Encode Uses

func (c *Uint32sCoder) Encode() ([]byte, error)

type Uint64Coder Uses

type Uint64Coder struct {
    // contains filtered or unexported fields
}

func Uint64 Uses

func Uint64(v uint64) *Uint64Coder

func Uint64Ptr Uses

func Uint64Ptr(v *uint64) *Uint64Coder

func (*Uint64Coder) Decode Uses

func (c *Uint64Coder) Decode(content []byte) error

func (*Uint64Coder) Encode Uses

func (c *Uint64Coder) Encode() ([]byte, error)

type Uint64sCoder Uses

type Uint64sCoder struct {
    // contains filtered or unexported fields
}

func Uint64s Uses

func Uint64s(v []uint64) *Uint64sCoder

func Uint64sPtr Uses

func Uint64sPtr(v *[]uint64) *Uint64sCoder

func (*Uint64sCoder) Decode Uses

func (c *Uint64sCoder) Decode(content []byte) error

func (*Uint64sCoder) Encode Uses

func (c *Uint64sCoder) Encode() ([]byte, error)

type Uint8Coder Uses

type Uint8Coder struct {
    // contains filtered or unexported fields
}

func Uint8 Uses

func Uint8(v uint8) *Uint8Coder

func Uint8Ptr Uses

func Uint8Ptr(v *uint8) *Uint8Coder

func (*Uint8Coder) Decode Uses

func (c *Uint8Coder) Decode(content []byte) error

func (*Uint8Coder) Encode Uses

func (c *Uint8Coder) Encode() ([]byte, error)

type Uint8sCoder Uses

type Uint8sCoder struct {
    // contains filtered or unexported fields
}

func Uint8s Uses

func Uint8s(v []uint8) *Uint8sCoder

func Uint8sPtr Uses

func Uint8sPtr(v *[]uint8) *Uint8sCoder

func (*Uint8sCoder) Decode Uses

func (c *Uint8sCoder) Decode(content []byte) error

func (*Uint8sCoder) Encode Uses

func (c *Uint8sCoder) Encode() ([]byte, error)

type UintCoder Uses

type UintCoder struct {
    // contains filtered or unexported fields
}

func Uint Uses

func Uint(v uint) *UintCoder

func UintPtr Uses

func UintPtr(v *uint) *UintCoder

func (*UintCoder) Decode Uses

func (c *UintCoder) Decode(content []byte) error

func (*UintCoder) Encode Uses

func (c *UintCoder) Encode() ([]byte, error)

type UintsCoder Uses

type UintsCoder struct {
    // contains filtered or unexported fields
}

func Uints Uses

func Uints(v []uint) *UintsCoder

func UintsPtr Uses

func UintsPtr(v *[]uint) *UintsCoder

func (*UintsCoder) Decode Uses

func (c *UintsCoder) Decode(content []byte) error

func (*UintsCoder) Encode Uses

func (c *UintsCoder) Encode() ([]byte, error)

type Unmarshaler Uses

type Unmarshaler interface {
    DecodeRapidash(Decoder) error
}

type Value Uses

type Value struct {
    IsNil bool
    Set   func(interface{})
    EQ    func(*Value) bool
    NEQ   func(*Value) bool
    LT    func(*Value) bool
    LTE   func(*Value) bool
    GT    func(*Value) bool
    GTE   func(*Value) bool

    String   func() string
    Hash     func() uint32
    RawValue func() interface{}
    // contains filtered or unexported fields
}

func NewBoolValue Uses

func NewBoolValue(v bool) *Value

func NewBytesValue Uses

func NewBytesValue(v []byte) *Value

func NewFloat32Value Uses

func NewFloat32Value(v float32) *Value

func NewFloat64Value Uses

func NewFloat64Value(v float64) *Value

func NewInt16Value Uses

func NewInt16Value(v int16) *Value

func NewInt32Value Uses

func NewInt32Value(v int32) *Value

func NewInt64Value Uses

func NewInt64Value(v int64) *Value

func NewInt8Value Uses

func NewInt8Value(v int8) *Value

func NewIntValue Uses

func NewIntValue(v int) *Value

func NewNilValue Uses

func NewNilValue() *Value

func NewStringValue Uses

func NewStringValue(v string) *Value

func NewTimeValue Uses

func NewTimeValue(v time.Time) *Value

func NewUint16Value Uses

func NewUint16Value(v uint16) *Value

func NewUint32Value Uses

func NewUint32Value(v uint32) *Value

func NewUint64Value Uses

func NewUint64Value(v uint64) *Value

func NewUint8Value Uses

func NewUint8Value(v uint8) *Value

func NewUintValue Uses

func NewUintValue(v uint) *Value

func StructSliceValueToValue Uses

func StructSliceValueToValue(v *StructSliceValue) *Value

func StructValueToValue Uses

func StructValueToValue(v *StructValue) *Value

func ValuesToValue Uses

func ValuesToValue(v []*Value) *Value

func (*Value) Release Uses

func (v *Value) Release()

func (*Value) Scan Uses

func (v *Value) Scan(src interface{}) error

type ValueDecoder Uses

type ValueDecoder struct {
    // contains filtered or unexported fields
}

func NewDecoder Uses

func NewDecoder(s *Struct, buf *bytes.Buffer, valueFactory *ValueFactory) *ValueDecoder

func (*ValueDecoder) Decode Uses

func (d *ValueDecoder) Decode() (*StructValue, error)

func (*ValueDecoder) DecodeSlice Uses

func (d *ValueDecoder) DecodeSlice() (*StructSliceValue, error)

func (*ValueDecoder) SetBuffer Uses

func (d *ValueDecoder) SetBuffer(content []byte)

type ValueFactory Uses

type ValueFactory struct {
    // contains filtered or unexported fields
}

func NewValueFactory Uses

func NewValueFactory() *ValueFactory

func (*ValueFactory) CreateBoolPtrValue Uses

func (f *ValueFactory) CreateBoolPtrValue(v *bool) *Value

func (*ValueFactory) CreateBoolValue Uses

func (f *ValueFactory) CreateBoolValue(v bool) *Value

func (*ValueFactory) CreateBytesPtrValue Uses

func (f *ValueFactory) CreateBytesPtrValue(v *[]byte) *Value

func (*ValueFactory) CreateBytesValue Uses

func (f *ValueFactory) CreateBytesValue(v []byte) *Value

func (*ValueFactory) CreateDefaultValue Uses

func (f *ValueFactory) CreateDefaultValue(typ TypeID) *Value

func (*ValueFactory) CreateFloat32PtrValue Uses

func (f *ValueFactory) CreateFloat32PtrValue(v *float32) *Value

func (*ValueFactory) CreateFloat32Value Uses

func (f *ValueFactory) CreateFloat32Value(v float32) *Value

func (*ValueFactory) CreateFloat64PtrValue Uses

func (f *ValueFactory) CreateFloat64PtrValue(v *float64) *Value

func (*ValueFactory) CreateFloat64Value Uses

func (f *ValueFactory) CreateFloat64Value(v float64) *Value

func (*ValueFactory) CreateInt16PtrValue Uses

func (f *ValueFactory) CreateInt16PtrValue(v *int16) *Value

func (*ValueFactory) CreateInt16Value Uses

func (f *ValueFactory) CreateInt16Value(v int16) *Value

func (*ValueFactory) CreateInt32PtrValue Uses

func (f *ValueFactory) CreateInt32PtrValue(v *int32) *Value

func (*ValueFactory) CreateInt32Value Uses

func (f *ValueFactory) CreateInt32Value(v int32) *Value

func (*ValueFactory) CreateInt64PtrValue Uses

func (f *ValueFactory) CreateInt64PtrValue(v *int64) *Value

func (*ValueFactory) CreateInt64Value Uses

func (f *ValueFactory) CreateInt64Value(v int64) *Value

func (*ValueFactory) CreateInt8PtrValue Uses

func (f *ValueFactory) CreateInt8PtrValue(v *int8) *Value

func (*ValueFactory) CreateInt8Value Uses

func (f *ValueFactory) CreateInt8Value(v int8) *Value

func (*ValueFactory) CreateIntPtrValue Uses

func (f *ValueFactory) CreateIntPtrValue(v *int) *Value

func (*ValueFactory) CreateIntValue Uses

func (f *ValueFactory) CreateIntValue(v int) *Value

func (*ValueFactory) CreateStringPtrValue Uses

func (f *ValueFactory) CreateStringPtrValue(v *string) *Value

func (*ValueFactory) CreateStringValue Uses

func (f *ValueFactory) CreateStringValue(v string) *Value

func (*ValueFactory) CreateTimePtrValue Uses

func (f *ValueFactory) CreateTimePtrValue(v *time.Time) *Value

func (*ValueFactory) CreateTimeValue Uses

func (f *ValueFactory) CreateTimeValue(v time.Time) *Value

func (*ValueFactory) CreateUint16PtrValue Uses

func (f *ValueFactory) CreateUint16PtrValue(v *uint16) *Value

func (*ValueFactory) CreateUint16Value Uses

func (f *ValueFactory) CreateUint16Value(v uint16) *Value

func (*ValueFactory) CreateUint32PtrValue Uses

func (f *ValueFactory) CreateUint32PtrValue(v *uint32) *Value

func (*ValueFactory) CreateUint32Value Uses

func (f *ValueFactory) CreateUint32Value(v uint32) *Value

func (*ValueFactory) CreateUint64PtrValue Uses

func (f *ValueFactory) CreateUint64PtrValue(v *uint64) *Value

func (*ValueFactory) CreateUint64Value Uses

func (f *ValueFactory) CreateUint64Value(v uint64) *Value

func (*ValueFactory) CreateUint8PtrValue Uses

func (f *ValueFactory) CreateUint8PtrValue(v *uint8) *Value

func (*ValueFactory) CreateUint8Value Uses

func (f *ValueFactory) CreateUint8Value(v uint8) *Value

func (*ValueFactory) CreateUintPtrValue Uses

func (f *ValueFactory) CreateUintPtrValue(v *uint) *Value

func (*ValueFactory) CreateUintValue Uses

func (f *ValueFactory) CreateUintValue(v uint) *Value

func (*ValueFactory) CreateUniqueValues Uses

func (f *ValueFactory) CreateUniqueValues(v interface{}) []*Value

func (*ValueFactory) CreateValue Uses

func (f *ValueFactory) CreateValue(v interface{}) *Value

func (*ValueFactory) CreateValueFromString Uses

func (f *ValueFactory) CreateValueFromString(v string, typeID TypeID) (*Value, error)

type ValueIterator Uses

type ValueIterator struct {
    // contains filtered or unexported fields
}

func NewValueIterator Uses

func NewValueIterator(keys []server.CacheKey) *ValueIterator

func (*ValueIterator) Error Uses

func (i *ValueIterator) Error() error

func (*ValueIterator) Next Uses

func (i *ValueIterator) Next() bool

func (*ValueIterator) PrimaryKey Uses

func (i *ValueIterator) PrimaryKey() server.CacheKey

func (*ValueIterator) QueryByPrimaryKey Uses

func (i *ValueIterator) QueryByPrimaryKey(factory *ValueFactory, primaryIndex *Index) (*Query, error)

func (*ValueIterator) Reset Uses

func (i *ValueIterator) Reset()

func (*ValueIterator) SetError Uses

func (i *ValueIterator) SetError(err error)

func (*ValueIterator) SetErrorWithKey Uses

func (i *ValueIterator) SetErrorWithKey(key server.CacheKey, err error)

func (*ValueIterator) SetValue Uses

func (i *ValueIterator) SetValue(value *StructValue)

func (*ValueIterator) SetValueWithKey Uses

func (i *ValueIterator) SetValueWithKey(key server.CacheKey, value *StructValue)

func (*ValueIterator) Value Uses

func (i *ValueIterator) Value() *StructValue

type Values Uses

type Values []*Value

func (Values) At Uses

func (v Values) At(idx int) Decoder

func (Values) Bool Uses

func (Values) Bool(string) bool

func (Values) BoolPtr Uses

func (Values) BoolPtr(string) *bool

func (Values) Bools Uses

func (Values) Bools(string) []bool

func (Values) Bytes Uses

func (Values) Bytes(string) []byte

func (Values) BytesPtr Uses

func (Values) BytesPtr(string) *[]byte

func (Values) Error Uses

func (Values) Error() error

func (Values) Float32 Uses

func (Values) Float32(string) float32

func (Values) Float32Ptr Uses

func (Values) Float32Ptr(string) *float32

func (Values) Float32s Uses

func (Values) Float32s(string) []float32

func (Values) Float64 Uses

func (Values) Float64(string) float64

func (Values) Float64Ptr Uses

func (Values) Float64Ptr(string) *float64

func (Values) Float64s Uses

func (Values) Float64s(string) []float64

func (Values) Int Uses

func (Values) Int(string) int

func (Values) Int16 Uses

func (Values) Int16(string) int16

func (Values) Int16Ptr Uses

func (Values) Int16Ptr(string) *int16

func (Values) Int16s Uses

func (Values) Int16s(string) []int16

func (Values) Int32 Uses

func (Values) Int32(string) int32

func (Values) Int32Ptr Uses

func (Values) Int32Ptr(string) *int32

func (Values) Int32s Uses

func (Values) Int32s(string) []int32

func (Values) Int64 Uses

func (Values) Int64(string) int64

func (Values) Int64Ptr Uses

func (Values) Int64Ptr(string) *int64

func (Values) Int64s Uses

func (Values) Int64s(string) []int64

func (Values) Int8 Uses

func (Values) Int8(string) int8

func (Values) Int8Ptr Uses

func (Values) Int8Ptr(string) *int8

func (Values) Int8s Uses

func (Values) Int8s(string) []int8

func (Values) IntPtr Uses

func (Values) IntPtr(string) *int

func (Values) Ints Uses

func (Values) Ints(string) []int

func (Values) Len Uses

func (v Values) Len() int

func (Values) Slice Uses

func (Values) Slice(string, Unmarshaler)

func (Values) String Uses

func (Values) String(string) string

func (Values) StringPtr Uses

func (Values) StringPtr(string) *string

func (Values) Strings Uses

func (Values) Strings(string) []string

func (Values) Struct Uses

func (Values) Struct(string, Unmarshaler)

func (Values) Time Uses

func (Values) Time(string) time.Time

func (Values) TimePtr Uses

func (Values) TimePtr(string) *time.Time

func (Values) Times Uses

func (Values) Times(string) []time.Time

func (Values) Uint Uses

func (Values) Uint(string) uint

func (Values) Uint16 Uses

func (Values) Uint16(string) uint16

func (Values) Uint16Ptr Uses

func (Values) Uint16Ptr(string) *uint16

func (Values) Uint16s Uses

func (Values) Uint16s(string) []uint16

func (Values) Uint32 Uses

func (Values) Uint32(string) uint32

func (Values) Uint32Ptr Uses

func (Values) Uint32Ptr(string) *uint32

func (Values) Uint32s Uses

func (Values) Uint32s(string) []uint32

func (Values) Uint64 Uses

func (Values) Uint64(string) uint64

func (Values) Uint64Ptr Uses

func (Values) Uint64Ptr(string) *uint64

func (Values) Uint64s Uses

func (Values) Uint64s(string) []uint64

func (Values) Uint8 Uses

func (Values) Uint8(string) uint8

func (Values) Uint8Ptr Uses

func (Values) Uint8Ptr(string) *uint8

func (Values) Uint8s Uses

func (Values) Uint8s(string) []uint8

func (Values) UintPtr Uses

func (Values) UintPtr(string) *uint

func (Values) Uints Uses

func (Values) Uints(string) []uint

Directories

PathSynopsis
server

Package rapidash imports 23 packages (graph). Updated 2020-03-25. Refresh now. Tools for package owners.