Documentation ¶
Index ¶
- Constants
- func Cmd(commandName string, params []string) (string, error)
- func CmdDir(dir string, commandName string, params []string) (string, error)
- func CmdDirToShow(dir string, commandName string, params []string, f func(string)) error
- func Either(list ...string) string
- func FirstLower(s string) string
- func FirstUpper(s string) string
- func GetAccesslogPath() string
- func GetAppName() string
- func GetDate() string
- func GetDcName() string
- func GetHostname() string
- func GetMetaData(ctx context.Context, key string) string
- func GetMetaDataMulti(ctx context.Context, keys []string) map[string]string
- func GetRunTime() string
- func GetZone() string
- func IsDev() bool
- func IsLocal() bool
- func IsPre() bool
- func IsRelease() bool
- func IsTest() bool
- func IsUat() bool
- func LogContentUnmarshal(content string) interface{}
- func OnRelease()
- func PrintBanner(name string)
- func Random(l int, randomRange string) string
- func Random09(l int) string
- func Random0Z(l int) string
- func RandomI(min int, max int) int
- func RandomI64(min int, max int) int64
- func Retry(fc func() error, maxRetries int, interval time.Duration) error
- func SetMetaData(ctx context.Context, key string, val string) context.Context
- func SetMetaDataMulti(ctx context.Context, kvs map[string]string) context.Context
- func WithoutCancel(parent context.Context) context.Context
- type TraceHeader
- type TypeTransform
Constants ¶
View Source
const ( XRequestId = "x-request-id" XB3TraceId = "x-b3-traceid" XB3SpanId = "x-b3-spanid" XB3ParentSpanId = "x-b3-parentspanid" XB3Sampled = "x-b3-sampled" XB3Flags = "x-b3-flags" B3 = "b3" XOtSpanContext = "x-ot-span-context" XAppName = "x-app-name" )
View Source
const ( LocalEnv = "local" DevEnv = "dev" TestEnv = "test" UatEnv = "uat" PreEnv = "pre" ReleaseEnv = "onl" )
View Source
const TimeFormat = "2006-01-02T15:04:05.000Z0700"
Variables ¶
This section is empty.
Functions ¶
func CmdDirToShow ¶ added in v2.0.9
CmdDirToShow 指定目录执行命令,并且处理每一条返回
func GetAccesslogPath ¶ added in v2.1.8
func GetAccesslogPath() string
GetAccesslogPath accesslog path
func GetAppName ¶ added in v2.1.14
func GetAppName() string
func GetHostname ¶ added in v2.1.18
func GetHostname() string
func GetMetaDataMulti ¶ added in v2.1.18
func LogContentUnmarshal ¶ added in v2.1.21
func LogContentUnmarshal(content string) interface{}
func PrintBanner ¶ added in v2.0.2
func PrintBanner(name string)
func SetMetaData ¶ added in v2.1.18
func SetMetaDataMulti ¶ added in v2.1.18
Types ¶
type TraceHeader ¶ added in v2.0.2
func SetGrpc ¶ added in v2.0.2
func SetGrpc(ctx context.Context) *TraceHeader
func SetHeader ¶ added in v2.0.2
func SetHeader(header interface{}) *TraceHeader
func SetHttp ¶ added in v2.0.2
func SetHttp(header http.Header) *TraceHeader
type TypeTransform ¶ added in v2.0.2
type TypeTransform struct {
Value interface{}
}
func Transform ¶ added in v2.0.2
func Transform(v interface{}) *TypeTransform
func (*TypeTransform) Bool ¶ added in v2.0.2
func (t *TypeTransform) Bool() bool
func (*TypeTransform) Float64 ¶ added in v2.0.2
func (t *TypeTransform) Float64() float64
func (*TypeTransform) Int ¶ added in v2.0.2
func (t *TypeTransform) Int() int
func (*TypeTransform) Int64 ¶ added in v2.0.2
func (t *TypeTransform) Int64() int64
func (*TypeTransform) Slice ¶ added in v2.0.2
func (t *TypeTransform) Slice() []interface{}
func (*TypeTransform) SliceString ¶ added in v2.0.2
func (t *TypeTransform) SliceString() []string
func (*TypeTransform) String ¶ added in v2.0.2
func (t *TypeTransform) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.