Documentation
¶
Index ¶
- Variables
- func DBG(format string, a ...interface{})
- func GetConfigDefault(key string, val ...string) string
- func GetConfigDefaultByInt(key string, val ...int) int
- func Init(svrTag string, opts ...core.KenanOption) error
- func LogError(text string, args ...interface{})
- func LogInfo(text string, args ...interface{})
- func LogInit()
- func LogWarn(text string, args ...interface{})
- func OpenDB(param DBParam) (*gorm.DB, error)
- func ParsingLocalConfig()
- func RPCXInit()
- func RegisterMS(svrArity interface{}, port string, limits ...int64) error
- func ReturnErrorMap(ack int, msg string) *map[string]interface{}
- func ReturnSuccessMap(d interface{}) *map[string]interface{}
- func RpcNewClient(node string) (client.XClient, error)
- func SetConfigFilePath(path string) core.KenanOption
- func SetLogConfig(pathPrefix string, rotationTime, maxAge time.Duration) core.KenanOption
- type Args
- func (args *Args) CallService(node, fun string, data interface{}) (*Reply, error)
- func (args *Args) ComplexAnalysis(body interface{}, headerObj interface{}) error
- func (args *Args) ComplexAnalysisSelf(headerObj interface{}) error
- func (args *Args) ReturnError(ack int, msg string, reply *Reply) error
- func (args *Args) ReturnErrorNative(ack int, msg string, reply *Reply) error
- func (args *Args) ReturnSuccess(d interface{}, reply *Reply) error
- func (args *Args) ReturnSuccessNative(d interface{}, reply *Reply, isByte ...bool) error
- func (args *Args) UseComplicated(body interface{}) []byte
- type ConnectionPlugin
- type DBParam
- type RCParam
- type RedisClass
- func (c *RedisClass) BRPopLPush(source, destination string) string
- func (c *RedisClass) DeleteKey(key string) bool
- func (c *RedisClass) ExistsHashKey(key string) bool
- func (c *RedisClass) ExistsStringKey(key string) bool
- func (c *RedisClass) GetIndexList(key string, dx int64) string
- func (c *RedisClass) GetList(key string) []string
- func (c *RedisClass) GetListLen(key string) int64
- func (c *RedisClass) GetString(key string) string
- func (c *RedisClass) GetStringByInt(key string) int
- func (c *RedisClass) GetStringByInt64(key string) int64
- func (c *RedisClass) GetTTL(key string) *redis.DurationCmd
- func (c *RedisClass) HGet(key string, fields string) string
- func (c *RedisClass) HGetAll(key string) map[string]string
- func (c *RedisClass) HGetInt(key string, fields string) int
- func (c *RedisClass) HGetInt64(key string, fields string) int64
- func (c *RedisClass) HIncrBy(key string, fields string, incr int64) error
- func (c *RedisClass) HMGet(key string, fields ...string) (map[string]string, error)
- func (c *RedisClass) HMSet(key string, kvPairs map[string]interface{}) error
- func (c *RedisClass) HSet(key string, fields string, val string) error
- func (c *RedisClass) HSetInt(key string, fields string, val int) error
- func (c *RedisClass) HSetInt64(key string, fields string, val int64) error
- func (c *RedisClass) Incr(sKey string) int64
- func (c *RedisClass) LPopList(key string) string
- func (c *RedisClass) PopList(key string) string
- func (c *RedisClass) PushList(key string, val string) error
- func (c *RedisClass) PushLists(key string, val []string) error
- func (c *RedisClass) RPopLPush(source, destination string) string
- func (c *RedisClass) RemoveListAll(key, value string)
- func (c *RedisClass) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
- func (c *RedisClass) SAdd(key string, fields string) int
- func (c *RedisClass) SCard(key string) int
- func (c *RedisClass) SIsMember(key, member string) bool
- func (c *RedisClass) SRandMember(key string) string
- func (c *RedisClass) SRem(key, member string) int
- func (c *RedisClass) SetIntExpire(key string, val int, expiration time.Duration) error
- func (c *RedisClass) SetInterfaceExpire(key string, val interface{}, expiration time.Duration) error
- func (c *RedisClass) SetNX(key, val string, expiration time.Duration) (bool, error)
- func (c *RedisClass) SetPersist(key string) bool
- func (c *RedisClass) SetString(key string, val string) error
- func (c *RedisClass) SetStringExpire(key string, val string, expiration time.Duration) error
- func (c *RedisClass) UpdateKeyExpire(key string, expiration time.Duration) bool
- func (c *RedisClass) ZAdd(key, member string, score float64) int64
- func (c *RedisClass) ZIncrBy(key, member string, increment int64) int
- func (c *RedisClass) ZRangeByScore(key, min, max string) []string
- func (c *RedisClass) ZRem(key, member string) int64
- func (c *RedisClass) ZScore(key, member string) int
- type Reply
- type Router
- func (app *Router) CallService(serverPath, fun string, session map[string]interface{}) (*map[string]interface{}, error)
- func (app *Router) CallServiceReply(serverPath, fun string, session map[string]interface{}) (*Reply, error)
- func (app *Router) CreateNewLink(ctx iris.Context) error
- func (app *Router) ReturnToClientMap(m1 *map[string]interface{}, statusCode ...int)
Constants ¶
This section is empty.
Variables ¶
var RpcMapSync sync.Map
RpcMapSync 线程安全的Rpc客户端实例map
Functions ¶
func GetConfigDefault ¶
GetConfigDefault 获取开放配置文件的值,为空则用默认值
func GetConfigDefaultByInt ¶
GetConfigDefaultByInt 读取配置文件节点,整形
func ParsingLocalConfig ¶
func ParsingLocalConfig()
func RegisterMS ¶ added in v1.0.8
RegisterMS 微服务注册 port注册端口
func ReturnErrorMap ¶ added in v1.0.8
func ReturnSuccessMap ¶ added in v1.0.8
func ReturnSuccessMap(d interface{}) *map[string]interface{}
func RpcNewClient ¶ added in v1.0.8
RpcNewClient RPC客户端注册
func SetConfigFilePath ¶
func SetConfigFilePath(path string) core.KenanOption
SetConfigFilePath 设置配置文件路径,比如‘./config.yaml’
func SetLogConfig ¶
func SetLogConfig(pathPrefix string, rotationTime, maxAge time.Duration) core.KenanOption
SetLogConfig 设置日志配置
Types ¶
type Args ¶ added in v1.0.8
func (*Args) CallService ¶ added in v1.0.8
func (*Args) ComplexAnalysis ¶ added in v1.0.8
ComplexAnalysis 解析指定的复杂Data到内存对象
func (*Args) ComplexAnalysisSelf ¶ added in v1.0.8
ComplexAnalysisSelf 解析来自调用方返回的复杂Data到内存对象
func (*Args) ReturnError ¶ added in v1.0.8
func (*Args) ReturnErrorNative ¶ added in v1.0.8
func (*Args) ReturnSuccess ¶ added in v1.0.8
func (*Args) ReturnSuccessNative ¶ added in v1.0.8
func (*Args) UseComplicated ¶ added in v1.0.8
UseComplicated 复杂对象转为[]byte
type ConnectionPlugin ¶ added in v1.0.8
type ConnectionPlugin struct {
}
ConnectionPlugin RPC连接插件
func (*ConnectionPlugin) HandleConnAccept ¶ added in v1.0.8
HandleConnAccept Rpc客户端连接
func (*ConnectionPlugin) HandleConnClose ¶ added in v1.0.8
func (p *ConnectionPlugin) HandleConnClose(conn net.Conn) bool
HandleConnClose Rpc客户端关闭
type RedisClass ¶ added in v1.0.7
type RedisClass struct {
// contains filtered or unexported fields
}
func OpenRedis ¶ added in v1.0.7
func OpenRedis(param RCParam) (*RedisClass, error)
OpenRedis 获取redis连接
func (*RedisClass) BRPopLPush ¶ added in v1.0.7
func (c *RedisClass) BRPopLPush(source, destination string) string
BRPopLPush BRPopLPush
func (*RedisClass) DeleteKey ¶ added in v1.0.7
func (c *RedisClass) DeleteKey(key string) bool
DeleteKey DeleteKey
func (*RedisClass) ExistsHashKey ¶ added in v1.0.7
func (c *RedisClass) ExistsHashKey(key string) bool
ExistsHashKey 更优雅的检查hash类型 key 是否存在
func (*RedisClass) ExistsStringKey ¶ added in v1.0.7
func (c *RedisClass) ExistsStringKey(key string) bool
ExistsStringKey 更优雅的检查string类型 key 是否存在
func (*RedisClass) GetIndexList ¶ added in v1.0.7
func (c *RedisClass) GetIndexList(key string, dx int64) string
GetIndexList 通过索引获取列表中的元素
func (*RedisClass) GetList ¶ added in v1.0.7
func (c *RedisClass) GetList(key string) []string
GetList GetList
func (*RedisClass) GetListLen ¶ added in v1.0.7
func (c *RedisClass) GetListLen(key string) int64
GetListLen GetListLen
func (*RedisClass) GetString ¶ added in v1.0.7
func (c *RedisClass) GetString(key string) string
GetString 获取KEY
func (*RedisClass) GetStringByInt ¶ added in v1.0.7
func (c *RedisClass) GetStringByInt(key string) int
func (*RedisClass) GetStringByInt64 ¶ added in v1.0.7
func (c *RedisClass) GetStringByInt64(key string) int64
func (*RedisClass) GetTTL ¶ added in v1.0.7
func (c *RedisClass) GetTTL(key string) *redis.DurationCmd
func (*RedisClass) HGet ¶ added in v1.0.7
func (c *RedisClass) HGet(key string, fields string) string
func (*RedisClass) HGetAll ¶ added in v1.0.7
func (c *RedisClass) HGetAll(key string) map[string]string
func (*RedisClass) HGetInt ¶ added in v1.0.7
func (c *RedisClass) HGetInt(key string, fields string) int
func (*RedisClass) HGetInt64 ¶ added in v1.0.7
func (c *RedisClass) HGetInt64(key string, fields string) int64
func (*RedisClass) HIncrBy ¶ added in v1.0.7
func (c *RedisClass) HIncrBy(key string, fields string, incr int64) error
HIncrBy HIncrBy
func (*RedisClass) HMSet ¶ added in v1.0.7
func (c *RedisClass) HMSet(key string, kvPairs map[string]interface{}) error
HMSet HMSet
func (*RedisClass) HSet ¶ added in v1.0.7
func (c *RedisClass) HSet(key string, fields string, val string) error
HSet HSet
func (*RedisClass) HSetInt ¶ added in v1.0.7
func (c *RedisClass) HSetInt(key string, fields string, val int) error
HSetInt HSetInt
func (*RedisClass) HSetInt64 ¶ added in v1.0.7
func (c *RedisClass) HSetInt64(key string, fields string, val int64) error
HSetInt64 HSetInt64
func (*RedisClass) Incr ¶ added in v1.0.7
func (c *RedisClass) Incr(sKey string) int64
Incr 将 key 中储存的数字值增一
func (*RedisClass) LPopList ¶ added in v1.0.7
func (c *RedisClass) LPopList(key string) string
LPopList 移除并获取列表第一个元素
func (*RedisClass) PopList ¶ added in v1.0.7
func (c *RedisClass) PopList(key string) string
PopList 移除并获取列表最后一个元素
func (*RedisClass) PushList ¶ added in v1.0.7
func (c *RedisClass) PushList(key string, val string) error
PushList 存入队列(左进)
func (*RedisClass) PushLists ¶ added in v1.0.7
func (c *RedisClass) PushLists(key string, val []string) error
PushLists 多个值存入队列(左进)
func (*RedisClass) RPopLPush ¶ added in v1.0.7
func (c *RedisClass) RPopLPush(source, destination string) string
RPopLPush RPopLPush
func (*RedisClass) RemoveListAll ¶ added in v1.0.7
func (c *RedisClass) RemoveListAll(key, value string)
RemoveListAll 移除表中所有与 value 相等的值
func (*RedisClass) RunScript ¶ added in v1.0.7
func (c *RedisClass) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
func (*RedisClass) SCard ¶ added in v1.0.7
func (c *RedisClass) SCard(key string) int
func (*RedisClass) SIsMember ¶ added in v1.0.7
func (c *RedisClass) SIsMember(key, member string) bool
func (*RedisClass) SRandMember ¶ added in v1.0.7
func (c *RedisClass) SRandMember(key string) string
func (*RedisClass) SRem ¶ added in v1.0.7
func (c *RedisClass) SRem(key, member string) int
func (*RedisClass) SetIntExpire ¶ added in v1.0.7
SetIntExpire 设置KEY值
func (*RedisClass) SetInterfaceExpire ¶ added in v1.0.7
func (c *RedisClass) SetInterfaceExpire(key string, val interface{}, expiration time.Duration) error
SetInterfaceExpire 设置KEY值
func (*RedisClass) SetPersist ¶ added in v1.0.7
func (c *RedisClass) SetPersist(key string) bool
SetPersist 将易失键转永久键
func (*RedisClass) SetString ¶ added in v1.0.7
func (c *RedisClass) SetString(key string, val string) error
SetString 设置KEY值
func (*RedisClass) SetStringExpire ¶ added in v1.0.7
SetStringExpire 设置KEY值
func (*RedisClass) UpdateKeyExpire ¶ added in v1.0.7
func (c *RedisClass) UpdateKeyExpire(key string, expiration time.Duration) bool
UpdateKeyExpire 更新key过期时间
func (*RedisClass) ZAdd ¶ added in v1.0.7
func (c *RedisClass) ZAdd(key, member string, score float64) int64
func (*RedisClass) ZIncrBy ¶ added in v1.0.7
func (c *RedisClass) ZIncrBy(key, member string, increment int64) int
ZIncrBy ZIncrBy
func (*RedisClass) ZRangeByScore ¶ added in v1.0.7
func (c *RedisClass) ZRangeByScore(key, min, max string) []string
func (*RedisClass) ZRem ¶ added in v1.0.7
func (c *RedisClass) ZRem(key, member string) int64
ZRem 移除有序列表指定值
func (*RedisClass) ZScore ¶ added in v1.0.7
func (c *RedisClass) ZScore(key, member string) int
ZScore 获取有序列表分数
type Reply ¶ added in v1.0.8
func (*Reply) ComplexAnalysis ¶ added in v1.0.8
ComplexAnalysis 解析Call返回的复杂Data到内存对象