Documentation ¶
Overview ¶
Package util go实用库 RSA的签名及验签 SHA256 With RSA
Package util go实用库 RSA的签名及验签 SHA256 With RSA
Package util go实用库 安全散列算法SHA常用函数
Index ¶
- Constants
- func Ceil(v float64) float64
- func Date(s, layout string) (int64, error)
- func Floor(v float64) float64
- func LimitOffset(page, pageSize int64) (limit, offset uint64)
- func MD5(s string) string
- func MobileEncode(mobile string) string
- func ParseTimeByUUID(uuid string) (dateTime string, err error)
- func RSA(src, privateKey string) (s string, err error)
- func RSACheck(src, sign, publicKey string) (ok bool, err error)
- func Random(min, max int64) int64
- func RandomNumber() int64
- func RandomStr(length int) string
- func RandomString(length int) string
- func Response(w http.ResponseWriter, resp interface{}, err error)
- func Round(v float64, decimals int) float64
- func SHA256(s []byte) (r []byte, err error)
- func StringToTime(str, format string) (t time.Time, err error)
- func TimeToString(t time.Time, format string) string
- func UUID() (uuid string, err error)
- type Body
- type Client
- func (cli Client) Close() error
- func (cli Client) Delete(key string) (err error)
- func (cli Client) Get(key string) (value []byte, err error)
- func (cli Client) GetByPrefix(key string) (res []map[string][]byte, err error)
- func (cli Client) GetByPrefixDesc(key string) (res []map[string][]byte, err error)
- func (cli Client) GetConfig(serviceName string, mode string, prevision int64) (content string, version int64, err error)
- func (cli Client) GetOneByPrefix(keyPrefix string) (key string, value []byte, err error)
- func (cli Client) GetOneKeyByPrefix(keyPrefix string) (key string, err error)
- func (cli Client) GetPageListByPrefix(key string) (res []map[string][]byte, err error)
- func (cli Client) GetWithOption(key string, opts []clientv3.OpOption) (res []map[string][]byte, err error)
- func (cli Client) InitMerge(name, mode string, cPoint any) int64
- func (cli Client) Put(key, value string) error
- func (cli Client) Watch(serviceName, mode string, version int64, action func(string))
- type ModeVsersion
- type Service
- type ServiceConfig
Constants ¶
View Source
const ( ServiceInfoKeyPrefix = "service.info." ServiceConfigKeyPrefix = "service.config." )
Variables ¶
This section is empty.
Functions ¶
func LimitOffset ¶ added in v1.0.1
LimitOffset 用于获取sql分页的limit和offset
func ParseTimeByUUID ¶
ParseTimeByUUID 根据uuid, 获取生成该uuid的时间
func Response ¶
func Response(w http.ResponseWriter, resp interface{}, err error)
Types ¶
type Client ¶ added in v1.0.2
type Client struct {
// contains filtered or unexported fields
}
func NewEtcdCli ¶ added in v1.0.2
func (Client) GetByPrefix ¶ added in v1.0.2
func (Client) GetByPrefixDesc ¶ added in v1.0.2
获取key前缀的kv
func (Client) GetOneByPrefix ¶ added in v1.0.2
基于key降序获取key前缀的第一个kv
func (Client) GetOneKeyByPrefix ¶ added in v1.0.2
基于key降序获取key前缀的第一个key
func (Client) GetPageListByPrefix ¶ added in v1.0.2
func (Client) GetWithOption ¶ added in v1.0.2
func (cli Client) GetWithOption(key string, opts []clientv3.OpOption) (res []map[string][]byte, err error)
获取key前缀的kv
type ModeVsersion ¶ added in v1.0.2
type Service ¶ added in v1.0.2
type Service struct { Typ string `json:"type"` // 服务类型, api、rpc Summary string `json:"summary"` // 服务概述 CurrentVersion ModeVsersion `json:"currentVersion"` // 当前版本 }
Click to show internal directories.
Click to hide internal directories.