common

package
v0.0.0-...-41195d4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool interface {
	Set(string, string) error   // (key, JsonData)
	Get(string) (string, error) // (key, infoName)
	Del(string) error           // (key)
}

Pool is an interface of DB pool to annotate. e.g. Set("virt_name/instance-00000001", "{"OS-name": "testvm1"}") e.g. Set("virt_if/tap1e793b2b-8e", "{"OS-uuid": "df846647-c16a-4d8a-842a-ac39bd4a971e"}")

type RedisPool

type RedisPool struct {
	Client *redis.Client
}

RedisPool is an implementation of Pool by redis.

func (RedisPool) Del

func (thisPool RedisPool) Del(key string) error

Del is to delete data in redis.

func (RedisPool) DelAll

func (thisPool RedisPool) DelAll() error

DelAll is to delete all data, begins with <redisLabel>, in redis.

func (RedisPool) Get

func (thisPool RedisPool) Get(key string) (string, error)

Get is to get data in redis.

func (RedisPool) Set

func (thisPool RedisPool) Set(key string, data string) error

Set is to set data in redis.

Jump to

Keyboard shortcuts

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