Documentation ¶
Index ¶
- Constants
- Variables
- func NewArrayInterfaceResult(val []interface{}, err error) *arrayInterfaceResult
- func NewBoolResult(val bool, err error) *boolResult
- func NewIntResult(val int64, err error) *intResult
- func NewInterfaceResult(val interface{}, err error) *interfaceResult
- func NewStatusResult(err error) *statusResult
- func NewStringResult(val string, err error) *stringResult
- func NewStringResultBytes(value []byte, err error) *stringResult
- func NewStringSliceResult(val []string, err error) *stringSliceResult
- func ToBytes(v int64) []byte
- func ToInt(b []byte) int64
- type ArrayInterfaceResult
- type BoolResult
- type ICache
- type IVectors
- type IntResult
- type InterfaceResult
- type Metrics
- type StatusResult
- type StringResult
- type StringSliceResult
- type TX
- type Vector
- type VectorsLocalBuild
Constants ¶
View Source
const CacheSkill = "github.com/eolinker/apinto/resources.resources.ICache"
View Source
const VectorsSkill = "github.com/eolinker/apinto/resources.resources.IVectors"
通过滑动窗口实现的平滑计数器
Variables ¶
View Source
var (
LocalCache func() ICache
)
View Source
var (
LocalVector func() IVectors
)
Functions ¶
func NewArrayInterfaceResult ¶ added in v0.15.11
func NewArrayInterfaceResult(val []interface{}, err error) *arrayInterfaceResult
func NewBoolResult ¶ added in v0.9.0
func NewIntResult ¶ added in v0.9.0
func NewInterfaceResult ¶ added in v0.14.9
func NewInterfaceResult(val interface{}, err error) *interfaceResult
func NewStatusResult ¶ added in v0.9.0
func NewStatusResult(err error) *statusResult
func NewStringResult ¶ added in v0.9.0
func NewStringResultBytes ¶ added in v0.9.0
func NewStringSliceResult ¶ added in v0.15.11
Types ¶
type ArrayInterfaceResult ¶ added in v0.15.11
type ArrayInterfaceResult interface {
Result() ([]interface{}, error)
}
type BoolResult ¶ added in v0.9.0
type ICache ¶
type ICache interface { Set(ctx context.Context, key string, value []byte, expiration time.Duration) StatusResult SetNX(ctx context.Context, key string, value []byte, expiration time.Duration) BoolResult DecrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) IntResult IncrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) IntResult Keys(ctx context.Context, key string) StringSliceResult Get(ctx context.Context, key string) StringResult GetDel(ctx context.Context, key string) StringResult HMSetN(ctx context.Context, key string, fields map[string]interface{}, expiration time.Duration) BoolResult HMGet(ctx context.Context, key string, fields ...string) ArrayInterfaceResult Del(ctx context.Context, keys ...string) IntResult Run(ctx context.Context, script interface{}, keys []string, args ...interface{}) InterfaceResult Tx() TX }
type InterfaceResult ¶ added in v0.14.9
type InterfaceResult interface {
Result() (interface{}, error)
}
type StatusResult ¶ added in v0.9.0
type StatusResult interface {
Result() error
}
type StringResult ¶ added in v0.9.0
type StringSliceResult ¶ added in v0.15.11
type VectorsLocalBuild ¶ added in v0.9.0
type VectorsLocalBuild struct {
// contains filtered or unexported fields
}
func NewVectorsLocalBuild ¶ added in v0.9.0
func NewVectorsLocalBuild() *VectorsLocalBuild
func (*VectorsLocalBuild) BuildVector ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.