keyStats

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL