cache

package
v0.0.0-...-1fd1f4e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserName       string = "userName"
	DcName         string = "dcName"
	DcId           string = "dcId"
	DeploymentName string = "deploymentName"
	OrgName        string = "orgName"
)
View Source
const (
	BuntCacheName = "BuntDB"
)
View Source
const (
	Sep string = " "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuntCache

type BuntCache struct {
	sync.Mutex
	DB      *buntdb.DB
	Hash    hashmap.HashMap
	Indexes []string
}

func BuntCacheInstance

func BuntCacheInstance() *BuntCache

func (*BuntCache) Create

func (c *BuntCache) Create(db string) error

Create

func (*BuntCache) Delete

func (c *BuntCache) Delete(key string) error

Delete

func (*BuntCache) Find

func (c *BuntCache) Find(args ...Indexer) (*map[string]string, error)

Find

func (*BuntCache) Index

func (c *BuntCache) Index(columns []string) error

Make Indexes

func (*BuntCache) Init

func (c *BuntCache) Init() error

func (*BuntCache) Search

func (c *BuntCache) Search(keyword string) (*map[string]string, error)

Search

func (*BuntCache) Update

func (c *BuntCache) Update(key, value string) error

Update

func (*BuntCache) Watch

func (c *BuntCache) Watch(name string) error

Watch

type Cache

type Cache interface {
	// ToDo: support multi-tenancy: namespace like k8s
	Create(db string) error
	Index(columns []string) error
	Update(key, value string) error
	Delete(key string) error
	Search(keyword string) (*map[string]string, error)
	Watch(name string) error
	Find(key string) ([]string, error)
}

type Deploy

type Deploy struct {
	Data []DeployInfo `json:"data"`
}

func (*Deploy) Unmarshal

func (deploy *Deploy) Unmarshal(content *[]byte) error

type DeployInfo

type DeployInfo struct {
	UserName       string `json:"userName"`
	DcName         string `json:"dcName"`
	DcID           int32  `json:"dcId"`
	OrgName        string `json:"orgName"`
	DeploymentName string `json:"deploymentName"`
	UpdateTime     string `json:"updateTime"`
}

type Indexer

type Indexer struct {
	Index string
	Key   string
}

type RedisCache

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

func NewRedisCache

func NewRedisCache() *RedisCache

func RedisCacheInstance

func RedisCacheInstance() *RedisCache

func (*RedisCache) Delete

func (rc *RedisCache) Delete(key string) (bool, error)

func (*RedisCache) Exist

func (rc *RedisCache) Exist(key string) (bool, error)

func (*RedisCache) Get

func (rc *RedisCache) Get(key string) string

func (*RedisCache) Llen

func (rc *RedisCache) Llen(key string) int32

func (*RedisCache) Lpush

func (rc *RedisCache) Lpush(key, value string) (bool, error)

func (*RedisCache) Lrange

func (rc *RedisCache) Lrange(key, start, end string) ([]string, error)

func (*RedisCache) Lrem

func (rc *RedisCache) Lrem(key, count, value string) (bool, error)

func (*RedisCache) Mget

func (rc *RedisCache) Mget(keys []string) interface{}

func (*RedisCache) Sadd

func (rc *RedisCache) Sadd(key, value string) (bool, error)

func (*RedisCache) Scard

func (rc *RedisCache) Scard(key string) (int32, error)

func (*RedisCache) Set

func (rc *RedisCache) Set(key, value string) (bool, error)

func (*RedisCache) Smember

func (rc *RedisCache) Smember(key string) ([]string, error)

func (*RedisCache) Srem

func (rc *RedisCache) Srem(key, value string) (bool, error)

Jump to

Keyboard shortcuts

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