redis

package
v0.0.0-...-343d9cb Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SEP = ":"

Variables

This section is empty.

Functions

func IDToString

func IDToString(id int64) string

func JoinKeyPath

func JoinKeyPath(keys ...interface{}) string

func ParseID

func ParseID(key string) int64

func SplitKeyPath

func SplitKeyPath(path string) []string

Types

type Repo

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

func NewRedisRepo

func NewRedisRepo(redisAddr string, idleSize int, idleTimeout time.Duration) *Repo

func (*Repo) AddSlotBanner

func (r *Repo) AddSlotBanner(slotID, bannerID int64) error

func (*Repo) CheckSlotHasBanner

func (r *Repo) CheckSlotHasBanner(slotID, bannerID int64) (bool, error)

func (*Repo) ClearBannerStats

func (r *Repo) ClearBannerStats(bannerID int64) error

ClearBannerStats clears banner's stats from all groups

func (*Repo) ClearGroupBannerStats

func (r *Repo) ClearGroupBannerStats(groupID, bannerID int64) error

func (*Repo) DelBannerDescription

func (r *Repo) DelBannerDescription(bannerID int64) error

func (*Repo) IncrClicks

func (r *Repo) IncrClicks(groupID, bannerID int64) error

func (*Repo) IncrShows

func (r *Repo) IncrShows(groupID, bannerID int64) error

func (*Repo) IncrStats

func (r *Repo) IncrStats(groupID, bannerID int64, kind StatKind) error

func (*Repo) ListBannerSlots

func (r *Repo) ListBannerSlots(bannerID int64) ([]int64, error)

func (*Repo) ListSlotBanners

func (r *Repo) ListSlotBanners(slotID int64) ([]int64, error)

func (*Repo) ListStats

func (r *Repo) ListStats(groupID int64) ([]*entity.Stat, error)

func (*Repo) RemoveSlotBanner

func (r *Repo) RemoveSlotBanner(slotID, bannerID int64) error

func (*Repo) SetBannerDescription

func (r *Repo) SetBannerDescription(bannerID int64, description string) error

type StatKind

type StatKind string
const (
	StatClicks StatKind = "clicks"
	StatShows  StatKind = "shows"
)

Jump to

Keyboard shortcuts

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