cache

package module
v1.0.1-beta.1.0...-997ce19 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

README

MiniPub Cache

Intro

A lightweight hashring cache solution.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ring

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

func NewRing

func NewRing(opt *RingOptions) (r *Ring)

func (*Ring) Close

func (r *Ring) Close() error

func (*Ring) Decr

func (r *Ring) Decr(key string, expiry int) (int64, error)

func (*Ring) DecrBy

func (r *Ring) DecrBy(key, num string, expiry int) (int64, error)

func (*Ring) Delete

func (r *Ring) Delete(key string) error

func (*Ring) Exists

func (r *Ring) Exists(key string) (bool, error)

func (*Ring) Expire

func (r *Ring) Expire(key string, expiry int) (bool, error)

func (*Ring) Get

func (r *Ring) Get(key string) (data []byte, err error)

func (*Ring) Incr

func (r *Ring) Incr(key string, expiry int) (int64, error)

func (*Ring) IncrBy

func (r *Ring) IncrBy(key, num string, expiry int) (int64, error)

func (*Ring) Set

func (r *Ring) Set(key string, value interface{}, expiry int) (err error)

type RingNode

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

func (*RingNode) String

func (rn *RingNode) String() string

type RingOptions

type RingOptions struct {
	Addrs       []string // address may with weight
	MaxIdle     int
	MaxActive   int
	IdleTimeout time.Duration
	Marshal     string
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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