Documentation ¶ Index ¶ type Counter func NewCounter(opt *Option) *Counter func (c *Counter) Incr(ctx context.Context, item *Item) func (c *Counter) IncrBy(ctx context.Context, item *Item, score int64) type Item func (i *Item) Marshal() string type Option Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Counter ¶ type Counter struct { // contains filtered or unexported fields } func NewCounter ¶ added in v0.2.7 func NewCounter(opt *Option) *Counter func (*Counter) Incr ¶ func (c *Counter) Incr(ctx context.Context, item *Item) func (*Counter) IncrBy ¶ func (c *Counter) IncrBy(ctx context.Context, item *Item, score int64) type Item ¶ type Item struct { Name string `json:"name"` Extra string `json:"extra"` } func (*Item) Marshal ¶ func (i *Item) Marshal() string type Option ¶ type Option struct { Service string Prefix string TTL time.Duration Redis redis.UniversalClient } Source Files ¶ View all Source files counter.go Click to show internal directories. Click to hide internal directories.