Documentation ¶
Index ¶
- Variables
- func JSONMarshalToString(v interface{}) string
- func MD5Hash(b []byte) string
- func MD5HashString(s string) string
- func MustUUID() string
- func NewTraceID() string
- func NewUUID() (string, error)
- func SHA1Hash(b []byte) string
- func SHA1HashString(s string) string
- type S
- func (s S) Bool() (bool, error)
- func (s S) Bytes() []byte
- func (s S) DefaultBool(defaultVal bool) bool
- func (s S) DefaultFloat32(defaultVal float32) float32
- func (s S) DefaultFloat64(defaultVal float64) float64
- func (s S) DefaultInt(defaultVal int) int
- func (s S) DefaultInt64(defaultVal int64) int64
- func (s S) DefaultUint(defaultVal uint) uint
- func (s S) DefaultUint64(defaultVal uint64) uint64
- func (s S) Float32() (float32, error)
- func (s S) Float64() (float64, error)
- func (s S) Int() (int, error)
- func (s S) Int64() (int64, error)
- func (s S) String() string
- func (s S) ToJSON(v interface{}) error
- func (s S) Uint() (uint, error)
- func (s S) Uint64() (uint64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JSONMarshal = json.Marshal JSONUnmarshal = json.Unmarshal JSONMarshalIndent = json.MarshalIndent JSONNewDecoder = json.NewDecoder JSONNewEncoder = json.NewEncoder )
Define JSON operations
Functions ¶
func JSONMarshalToString ¶
func JSONMarshalToString(v interface{}) string
JSONMarshalToString - JSON encoded as a string
Types ¶
type S ¶
type S string
S - String type conversion
func (S) DefaultBool ¶
DefaultBool - Convert to bool, use default if an error occurs
func (S) DefaultFloat32 ¶
DefaultFloat32 - Convert to float32, use default if an error occurs
func (S) DefaultFloat64 ¶
DefaultFloat64 - Convert to float64, use default if an error occurs
func (S) DefaultInt ¶
DefaultInt - Convert to int, use default if an error occurs
func (S) DefaultInt64 ¶
DefaultInt64 - Convert to int64, use default if an error occurs
func (S) DefaultUint ¶
DefaultUint - Convert to uint, use default if an error occurs
func (S) DefaultUint64 ¶
DefaultUint64 - Convert to uint64, use default if an error occurs
Click to show internal directories.
Click to hide internal directories.