redis_api

package module
v0.0.0-...-79a960b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 10 Imported by: 0

README

redis-api

Documentation

Index

Constants

View Source
const AddListValue = "add_list_value"

set use it

View Source
const ChangeConfig = "change_config"
View Source
const DelConfig = "del_config"
View Source
const DelHashField = "del_hash_field"
View Source
const DelKey = "del_key"
View Source
const DelListValue = "del_list_value"
View Source
const DelZsetField = "del_zset_field"
View Source
const GetKey = "get_key"

key

View Source
const Info = "get_server_info"

server

View Source
const RedisGeo = 6
View Source
const RedisHash = 5
View Source
const RedisList = 2
View Source
const RedisNone = 0

redis type

View Source
const RedisSet = 3
View Source
const RedisString = 1
View Source
const RedisUnknow = 9
View Source
const RedisZset = 4
View Source
const SetConfig = "set_config"

config

View Source
const SetHashField = "set_hash_field"
View Source
const SetTtl = "set_ttl"
View Source
const SetValue = "set_value"

string

View Source
const SetZsetField = "set_zset_field"

Variables

This section is empty.

Functions

func AddConnections

func AddConnections(config *RedisConfig) error

func ChangeConnection

func ChangeConnection(hval string, conf *RedisConfig) error

func DoOperation

func DoOperation(values url.Values) (bool, interface{})

func GetRedis

func GetRedis(hval string) *redisConnection

func GetRedisInConnections

func GetRedisInConnections(hval string) *redisConnection

func RemoveConnections

func RemoveConnections(hval string) error

Types

type Geo

type Geo struct {
	Values []map[string]*GeoValue `json:"values"`
}

func (*Geo) String

func (g *Geo) String() string

func (*Geo) Value

func (g *Geo) Value() interface{}

type GeoValue

type GeoValue struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

type Hash

type Hash struct {
	Values map[string]string `json:"value"`
}

func (*Hash) String

func (hash *Hash) String() string

func (*Hash) Value

func (hash *Hash) Value() interface{}

type HostConfig

type HostConfig struct {
	Host string `json:"host,omitempty"`
	Port int    `json:"port,omitempty"`
}

type KeyInfo

type KeyInfo struct {
	Db      int    `json:"db"`       //which db
	KeyName string `json:"key_name"` //keyname
	Type    uint8  `json:"type"`     //key type
	TTl     int64  `json:"ttl"`
	// contains filtered or unexported fields
}

key

func GetKeyInfo

func GetKeyInfo() *KeyInfo

func GetKeyInfoWithBasic

func GetKeyInfoWithBasic(key string, db int) *KeyInfo

func (*KeyInfo) GetDb

func (info *KeyInfo) GetDb() int

func (*KeyInfo) GetKeyName

func (info *KeyInfo) GetKeyName() string

func (*KeyInfo) GetTtl

func (info *KeyInfo) GetTtl() int64

func (*KeyInfo) GetType

func (info *KeyInfo) GetType() uint8

func (*KeyInfo) GetTypeString

func (info *KeyInfo) GetTypeString() string

func (*KeyInfo) SetTtlWithTime

func (info *KeyInfo) SetTtlWithTime(t time.Duration)

func (*KeyInfo) SetTypeWithString

func (info *KeyInfo) SetTypeWithString(t string)

func (*KeyInfo) String

func (info *KeyInfo) String() string

type KeyMap

type KeyMap map[int][]*KeyInfo

db key map lists

func GetKeyMap

func GetKeyMap() KeyMap

func (KeyMap) GetDbKeys

func (maps KeyMap) GetDbKeys(db int) []*KeyInfo

func (KeyMap) GetKeyWith

func (maps KeyMap) GetKeyWith(db int, keyName string) *KeyInfo

func (KeyMap) String

func (maps KeyMap) String() string

type KeyValues

type KeyValues struct {
	*KeyInfo `json:"key_info"`
	Value    interface{} `json:"value"`
}

func KeyOperation

func KeyOperation(conn *redisConnection, action string, values url.Values) *KeyValues

func (*KeyValues) String

func (values *KeyValues) String() string

type List

type List struct {
	Values []string `json:"value"`
}

func (*List) String

func (l *List) String() string

func (*List) Value

func (l *List) Value() interface{}

type Message

type Message struct {
	Url string

	Root        string
	FileHandler http.Handler
	// contains filtered or unexported fields
}

func (*Message) ServeHTTP

func (message *Message) ServeHTTP(res http.ResponseWriter, req *http.Request)

type RedisConfig

type RedisConfig struct {
	Name string `json:"name,omitempty"`
	Host string `json:"host,omitempty"`
	Db   int    `json:"db,omitempty"`
	Pw   string `json:"pw,omitempty"`
	Hval string `json:"hval"`
}

func InitConfig

func InitConfig(host, name, pw string) *RedisConfig

func (*RedisConfig) GetHval

func (RConf *RedisConfig) GetHval() string

func (*RedisConfig) GetName

func (RConf *RedisConfig) GetName() string

type RedisVhosts

type RedisVhosts map[string]*RedisConfig
var RedisHosts RedisVhosts

func (RedisVhosts) Add

func (hosts RedisVhosts) Add(RConf *RedisConfig) error

func (RedisVhosts) Edit

func (hosts RedisVhosts) Edit(hval string, New *RedisConfig) error

func (RedisVhosts) GetConfig

func (hosts RedisVhosts) GetConfig(Hval string) (*RedisConfig, error)

func (RedisVhosts) GetConfigByName

func (hosts RedisVhosts) GetConfigByName(name string) (*RedisConfig, error)

func (RedisVhosts) GetName

func (hosts RedisVhosts) GetName(Hval string) (string, error)

func (RedisVhosts) Remove

func (hosts RedisVhosts) Remove(hval string) error

type Render

type Render struct {
	Key   string
	Value ValueOf
}

type Set

type Set struct {
	Values []string `json:"value"`
}

func (*Set) String

func (set *Set) String() string

func (*Set) Value

func (set *Set) Value() interface{}

type String

type String struct {
	Values string `json:"value"`
}

func (*String) String

func (s *String) String() string

func (*String) Value

func (s *String) Value() interface{}

type ValueOf

type ValueOf interface {
	Value() interface{}
	String() string
}

func GetValue

func GetValue(redisType int, value interface{}) ValueOf

type Zset

type Zset struct {
	Values map[string]int64 `json:"value"`
}

func (*Zset) String

func (zset *Zset) String() string

func (*Zset) Value

func (zset *Zset) Value() interface{}

Jump to

Keyboard shortcuts

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