Documentation ¶
Overview ¶
Package provides some helping funcs, suchs as redis-related and settings parsing
Index ¶
- Constants
- Variables
- func AcquireSem(creator string)
- func BroadcastTxWithRetry(clientCtx client.Context, msgs sdk.Msg) error
- func CheckSign(content []byte) (*map[string]interface{}, error)
- func Combined(req fasthttp.RequestHandler) fasthttp.RequestHandler
- func FetchKey(kb keyring.Keyring, keyref string) (*keyring.Record, error)
- func InitSM2()
- func IsAlphanum(word string) bool
- func ReadSettings(yamlFilepath string)
- func ReleaseSem(creator string)
- func RespError(ctx *fasthttp.RequestCtx, code int, msg string)
- func RespJson(ctx *fasthttp.RequestCtx, data *map[string]interface{})
Constants ¶
View Source
const ( Limit = 1 // 同時并行运行的goroutine上限 Weight = 1 // 每个goroutine获取信号量资源的权重 )
Variables ¶
View Source
var ( /* 保存命令行context */ HttpCmd *cobra.Command )
View Source
var (
Settings = configYaml{}
)
Settings read from local YAML setting file located in 'config/settings.yaml'
Functions ¶
func BroadcastTxWithRetry ¶
封装 GenerateOrBroadcastTxCLI, 延时 retry 5次, 约10秒
func Combined ¶
func Combined(req fasthttp.RequestHandler) fasthttp.RequestHandler
Combined format: [<time>] <remote-addr> | <HTTP/http-version> | <method> <url> - <status> - <response-time us> | <user-agent> [2017/05/31 - 13:27:28] 127.0.0.1:54082 | HTTP/1.1 | GET /hello - 200 - 48.279µs | Paw/3.1.1 (Macintosh; OS X/10.12.5) GCDHTTPRequest
func IsAlphanum ¶
func ReadSettings ¶
func ReadSettings(yamlFilepath string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.