factory

package
v0.0.0-...-5745f2c Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory CacheInstance)

Types

type Cache

type Cache interface {
	Get(key string) ([]byte, error)
	Put(key string, val interface{}, timeout time.Duration) error
	Delete(key string) error
	Incr(key string) error
	Decr(key string) error
	IsExist(key string) bool
	ClearAll() error
	StartAndConfigure(ops ...CacheOption) error
	Close() error
}

func NewCache

func NewCache(name string, ops ...CacheOption) (c Cache, err error)

type CacheInstance

type CacheInstance func() Cache

type CacheOption

type CacheOption func(c Cache)

Jump to

Keyboard shortcuts

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