Documentation
¶
Index ¶
- func DecodeBase64(src []byte) ([]byte, error)
- func DecodeBase64String(str string) ([]byte, error)
- func EncodeBase64(src []byte) []byte
- func EncodeBase64ToString(src []byte) string
- func HandleCrash(additionalHandlers ...func(interface{}))
- func HandleCrashSilent(additionalHandlers ...func(interface{}))
- func MarshalJSON(v interface{}) ([]byte, error)
- func NormalizePath(path string) (string, error)
- func ToBool(i interface{}) bool
- func ToInt(i interface{}) int
- func ToString(i interface{}) string
- func ToStringSlice(i interface{}) []string
- func TryMarshalJSON(v interface{}) []byte
- func TryUnmarshalJSON(data []byte, v interface{})
- func UnmarshalJSON(data []byte, v interface{}) error
- func UnsafeBytesToString(bs []byte) string
- func UnsafeStringToBytes(s string) (bytes []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes the input bytes, which can accept padded or none padded format.
func DecodeBase64String ¶
DecodeBase64String decodes the input string, which can accept padded or none padded format.
func EncodeBase64 ¶
EncodeBase64 encodes the input bytes, and then output standard format.
func EncodeBase64ToString ¶
EncodeBase64ToString encodes the input bytes, and then output standard format string.
func HandleCrash ¶
func HandleCrash(additionalHandlers ...func(interface{}))
HandleCrash handles the crash with a default log handler.
func HandleCrashSilent ¶
func HandleCrashSilent(additionalHandlers ...func(interface{}))
HandleCrashSilent handles the crash without the default log handler.
func MarshalJSON ¶
MarshalJSON encodes the input object as JSON.
func NormalizePath ¶
NormalizePath returns an absolute path of given path.
func ToString ¶
func ToString(i interface{}) string
ToString tries to convert an interface to string value.
func ToStringSlice ¶
func ToStringSlice(i interface{}) []string
ToStringSlice tries to convert an interface to string slice.
func TryMarshalJSON ¶
func TryMarshalJSON(v interface{}) []byte
TryMarshalJson is the same as MarshalJSON but doesn't return error.
func TryUnmarshalJSON ¶
func TryUnmarshalJSON(data []byte, v interface{})
TryUnmarshalJSON is the same as UnmarshalJSON but doesn't return error.
func UnmarshalJSON ¶
UnmarshalJSON decodes the input JSON into the input handler.
func UnsafeBytesToString ¶
func UnsafeStringToBytes ¶
Types ¶
This section is empty.