Documentation ¶
Overview ¶
Package convertor implements some functions to convert data.
Index ¶
- func ColorHexToRGB(colorHex string) (red, green, blue int)
- func ColorRGBToHex(red, green, blue int) string
- func DecodeByte(data []byte, target interface{}) error
- func EncodeByte(data interface{}) ([]byte, error)
- func StructToMap(value interface{}) (map[string]interface{}, error)
- func ToBool(s string) (bool, error)
- func ToBytes(value interface{}) ([]byte, error)
- func ToChannel(array []interface{}) <-chan interface{}
- func ToChar(s string) []string
- func ToFloat(value interface{}) (float64, error)
- func ToInt(value interface{}) (int64, error)
- func ToJson(value interface{}) (string, error)
- func ToString(value interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorHexToRGB ¶
ColorHexToRGB convert hex color to rgb color
func ColorRGBToHex ¶
ColorRGBToHex convert rgb color to hex color
func DecodeByte ¶ added in v1.3.2
DecodeByte decode byte data to target object
func EncodeByte ¶ added in v1.3.2
EncodeByte encode data to byte
func StructToMap ¶
StructToMap convert struct to map, only convert exported struct field map key is specified same as struct field tag `json` value
func ToChannel ¶ added in v1.3.1
func ToChannel(array []interface{}) <-chan interface{}
ToChannel convert a array of elements to a read-only channels
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.