Documentation ¶
Index ¶
- Variables
- func AddBase64Padding(value string) string
- func AesCBCDecrypt(key []byte, text string) (string, error)
- func AesCBCEncrypt(key []byte, text string) (string, error)
- func CompareRuntimeVersion(version string) bool
- func CompareVersion(v1, v2 string, width int) string
- func CurrentTimeMills() int64
- func EchoStartWithGracefulShutdown(app *echo.Echo, addr string)
- func EchoStartWithGracefulShutdownThanGo18(app *echo.Echo, addr string)
- func EchoStartWithGracefulShutdownUseThirdPlugin(app *echo.Echo, addr string)
- func InStringSlice(slice []string, s string) bool
- func IntArithmetic(v1, v2 interface{}, t string) (result int64)
- func ModelType(value interface{}) reflect.Type
- func NewEcho() *echo.Echo
- func NewEchoHosts(hosts map[string]EchoHost) *echo.Echo
- func NewTemplate(name, patter string) *template.Template
- func PKCS5PaddingPad(src []byte) []byte
- func PKCS5PaddingUnpad(src []byte) ([]byte, error)
- func RandStr(strlen int) string
- func RandomString(strlen int) string
- func RegisterQueue(api, user, passwd, vhost, name, exchange, key string) error
- func RemoveBase64Padding(value string) string
- func ToBool(v interface{}) bool
- func ToFloat(v interface{}) float64
- func ToInt(v interface{}) int64
- func ToInt32(v interface{}) int32
- func ToInt64(v interface{}) int64
- func ToPrice(f float64) int64
- func ToString(v interface{}) (s string)
- type DefaultLogInstance
- func (c *DefaultLogInstance) Debug(format string, v ...interface{})
- func (c *DefaultLogInstance) Error(format string, v ...interface{})
- func (c *DefaultLogInstance) Fatal(format string, v ...interface{})
- func (c *DefaultLogInstance) Info(format string, v ...interface{})
- func (c *DefaultLogInstance) Panic(format string, v ...interface{})
- func (c *DefaultLogInstance) Sync()
- func (c *DefaultLogInstance) Warn(format string, v ...interface{})
- type EchoHost
- type EchoTemplate
- type Logger
- func (c *Logger) Debug(format string, v ...interface{})
- func (c *Logger) Error(format string, v ...interface{})
- func (c *Logger) Fatal(format string, v ...interface{})
- func (c *Logger) Info(format string, v ...interface{})
- func (c *Logger) Panic(format string, v ...interface{})
- func (c *Logger) Set(instance interface{})
- func (c *Logger) Sync()
- func (c *Logger) Warn(format string, v ...interface{})
- type LoggerInterface
- type Map
- func (c *Map) Get(key interface{}) (ret interface{}, ok bool)
- func (c *Map) GetBool(key interface{}) (bool, bool)
- func (c *Map) GetFloat(key interface{}) (float64, bool)
- func (c *Map) GetInt32(key interface{}) (int32, bool)
- func (c *Map) GetInt64(key interface{}) (int64, bool)
- func (c *Map) GetSlice(key interface{}) ([]interface{}, bool)
- func (c *Map) GetString(key interface{}) (string, bool)
- func (c *Map) GetStringSlice(key interface{}) ([]string, bool)
- func (c *Map) Int32(key interface{}, def ...interface{}) int32
- func (c *Map) Load(value interface{})
- func (c *Map) String(key interface{}, def ...interface{}) string
- type NullString
- type RMQHttpApi
- type RMQPermission
- type Resource
- type Tag
- type ZapLoggerInstance
- func (c *ZapLoggerInstance) Debug(format string, v ...interface{})
- func (c *ZapLoggerInstance) Error(format string, v ...interface{})
- func (c *ZapLoggerInstance) Fatal(format string, v ...interface{})
- func (c *ZapLoggerInstance) Info(format string, v ...interface{})
- func (c *ZapLoggerInstance) Panic(format string, v ...interface{})
- func (c *ZapLoggerInstance) Sync()
- func (c *ZapLoggerInstance) Warn(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RMQHttpApiTimeout time.Duration = 10 * time.Second
)
View Source
var ( TemplateHelpers = template.FuncMap{ "IntSub": func(v1 interface{}, v2 interface{}) int64 { return IntArithmetic(v1, v2, "-") }, "IntAdd": func(v1 interface{}, v2 interface{}) int64 { return IntArithmetic(v1, v2, "+") }, "ToLower": func(s interface{}) string { return strings.ToLower(ToString(s)) }, "Price": func(v int64) interface{} { str := strconv.FormatInt(v, 10) len := len(str) return str[:len-2] + "." + str[len-2:] }, "PriceInt": func(v int64) interface{} { str := strconv.FormatInt(v, 10) len := len(str) return str[:len-2] }, "unescape": func(s string) interface{} { return template.HTML(s) }, } )
Functions ¶
func AddBase64Padding ¶
func CompareRuntimeVersion ¶
* runtime version >= version; return true * runtime version < version; return false
func CompareVersion ¶
func CurrentTimeMills ¶
func CurrentTimeMills() int64
func InStringSlice ¶
func IntArithmetic ¶
* template helpers
func NewTemplate ¶
func PKCS5PaddingPad ¶
func PKCS5PaddingUnpad ¶
func RandomString ¶
func RegisterQueue ¶
func RemoveBase64Padding ¶
Types ¶
type DefaultLogInstance ¶
type DefaultLogInstance struct {
LoggerInterface
}
func (*DefaultLogInstance) Debug ¶
func (c *DefaultLogInstance) Debug(format string, v ...interface{})
func (*DefaultLogInstance) Error ¶
func (c *DefaultLogInstance) Error(format string, v ...interface{})
func (*DefaultLogInstance) Fatal ¶
func (c *DefaultLogInstance) Fatal(format string, v ...interface{})
func (*DefaultLogInstance) Info ¶
func (c *DefaultLogInstance) Info(format string, v ...interface{})
func (*DefaultLogInstance) Panic ¶
func (c *DefaultLogInstance) Panic(format string, v ...interface{})
func (*DefaultLogInstance) Sync ¶
func (c *DefaultLogInstance) Sync()
func (*DefaultLogInstance) Warn ¶
func (c *DefaultLogInstance) Warn(format string, v ...interface{})
type EchoTemplate ¶
type EchoTemplate struct {
// contains filtered or unexported fields
}
* echo templater support
func NewEchoRenderer ¶
func NewEchoRenderer(name, patter string) *EchoTemplate
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func DefaultLogger ¶
func DefaultLogger() *Logger
type LoggerInterface ¶
type NullString ¶
func EchoCtxFormNullString ¶
func EchoCtxFormNullString(ctx echo.Context, key string) (ret *NullString)
func EchoCtxQueryNullString ¶
func EchoCtxQueryNullString(ctx echo.Context, key string) (ret *NullString)
type RMQHttpApi ¶
type RMQHttpApi struct {
// contains filtered or unexported fields
}
func NewRMQHttpApi ¶
func NewRMQHttpApi(host, user, passwd string) (c *RMQHttpApi, err error)
func (*RMQHttpApi) Permissions ¶
func (c *RMQHttpApi) Permissions() ([]RMQPermission, error)
type RMQPermission ¶
type Resource ¶
func NewResource ¶
func NewResource(value interface{}) *Resource
func (*Resource) GetResource ¶
type ZapLoggerInstance ¶
type ZapLoggerInstance struct { LoggerInterface // contains filtered or unexported fields }
func (*ZapLoggerInstance) Debug ¶
func (c *ZapLoggerInstance) Debug(format string, v ...interface{})
func (*ZapLoggerInstance) Error ¶
func (c *ZapLoggerInstance) Error(format string, v ...interface{})
func (*ZapLoggerInstance) Fatal ¶
func (c *ZapLoggerInstance) Fatal(format string, v ...interface{})
func (*ZapLoggerInstance) Info ¶
func (c *ZapLoggerInstance) Info(format string, v ...interface{})
func (*ZapLoggerInstance) Panic ¶
func (c *ZapLoggerInstance) Panic(format string, v ...interface{})
func (*ZapLoggerInstance) Sync ¶
func (c *ZapLoggerInstance) Sync()
func (*ZapLoggerInstance) Warn ¶
func (c *ZapLoggerInstance) Warn(format string, v ...interface{})
Click to show internal directories.
Click to hide internal directories.