Documentation ¶
Index ¶
- Constants
- Variables
- func NewBoolResult(val bool, err error) *boolResult
- func NewIntResult(val int64, err error) *intResult
- func NewStatusResult(err error) *statusResult
- func NewStringResult(val string, err error) *stringResult
- func NewStringResultBytes(value []byte, err error) *stringResult
- func ToBytes(v int64) []byte
- func ToInt(b []byte) int64
- type BoolResult
- type ICache
- type IVectors
- type IntResult
- type Metrics
- type StatusResult
- type StringResult
- 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 NewBoolResult ¶ added in v0.9.0
func NewIntResult ¶ added in v0.9.0
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
Types ¶
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 Get(ctx context.Context, key string) StringResult GetDel(ctx context.Context, key string) StringResult Del(ctx context.Context, keys ...string) IntResult Tx() TX }
type StatusResult ¶ added in v0.9.0
type StatusResult interface {
Result() error
}
type StringResult ¶ added in v0.9.0
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.