Documentation
¶
Index ¶
- Variables
- func ArrayToObject(dataArray interface{}, targetPtrObj interface{}) error
- func Banner(filePath string)
- func Base64Decode(dst string) ([]byte, error)
- func Base64Encode(src []byte) string
- func Cast(fieldKind reflect.Kind, valueStr string) (any, error)
- func DataToObject(data any, targetPtrObj any) error
- func DefaultBanner()
- func GetPropertiesItemLineList(content string) []string
- func GroupBy(list []T, f func(T) K) map[K][]T
- func GroupByTo(list []T, dest *map[K][]T, f func(T) K) map[K][]T
- func GroupByTransform(list []T, f func(T) K, trans func(T) V) map[K][]V
- func GroupByTransformTo(list []T, dest *map[K][]V, f func(T) K, trans func(T) V) map[K][]V
- func IndexOf(list []T, item T) int
- func IndexOfCondition(list []T, f func(T) bool) int
- func IsBaseType(fieldType reflect.Type) bool
- func IsJson(content string) bool
- func IsNumber(fieldKing reflect.Kind) bool
- func IsPrivate(s string) bool
- func IsProperty(content string) bool
- func IsPublic(s string) bool
- func IsYaml(content string) bool
- func JoinToString(list []T, f func(T) string) string
- func JoinToStringFull(list []T, sep string, prefix string, postfix string, f func(T) string) string
- func JsonToMap(contentOfJson string) (map[string]interface{}, error)
- func JsonToYaml(contentOfJson string) (string, error)
- func KvToProperties(key, value string, valueType TypeEnum) (string, error)
- func LastIndexOf(list []T, item T) int
- func LastIndexOfCondition(list []T, f func(T) bool) int
- func ListAll(list []T, f func(T) bool) bool
- func ListAny(list []T, f func(T) bool) bool
- func ListContains(list []T, item T) bool
- func ListCount(list []T, f func(T) bool) int
- func ListNone(list []T, f func(T) bool) bool
- func MapAll(m map[K]V, f func(K, V) bool) bool
- func MapAllKey(m map[K]V, f func(K) bool) bool
- func MapAllValue(m map[K]V, f func(V) bool) bool
- func MapAny(m map[K]V, f func(K, V) bool) bool
- func MapAnyKey(m map[K]V, f func(K) bool) bool
- func MapAnyValue(m map[K]V, f func(V) bool) bool
- func MapContains(m map[K]V, k K, v V) bool
- func MapContainsKey(m map[K]V, k K) bool
- func MapContainsValue(m map[K]V, v V) bool
- func MapCount(m map[K]V, f func(K, V) bool) int
- func MapCountKey(m map[K]V, f func(K) bool) int
- func MapCountValue(m map[K]V, f func(V) bool) int
- func MapFilter(m map[K]V, f func(K, V) bool) map[K]V
- func MapFilterKeys(m map[K]V, f func(K) bool) map[K]V
- func MapFilterNot(m map[K]V, f func(K, V) bool) map[K]V
- func MapFilterNotTo(m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V
- func MapFilterTo(m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V
- func MapFilterValues(m map[K]V, f func(V) bool) map[K]V
- func MapNone(m map[K]V, f func(K, V) bool) bool
- func MapNoneKey(m map[K]V, f func(K) bool) bool
- func MapNoneValue(m map[K]V, f func(V) bool) bool
- func MapToObject(dataMap interface{}, targetPtrObj interface{}) error
- func MapToProperties(dataMap map[string]interface{}) (string, error)
- func ObjectToData(object interface{}) interface{}
- func ObjectToJson(object interface{}) string
- func ObjectToYaml(value interface{}) (string, error)
- func PropertiesEntityToYaml(properties Properties) (string, error)
- func PropertiesToMap(contentOfProperties string) (map[string]interface{}, error)
- func PropertiesToYaml(contentOfProperties string) (string, error)
- func ReaderToObject(reader io.Reader, targetPtrObj interface{}) error
- func StrToObject(contentOfJson string, targetPtrObj interface{}) error
- func ToBool(value any) bool
- func ToComplex64(value any) complex64
- func ToComplex128(value any) complex128
- func ToFloat32(value any) float32
- func ToFloat64(value any) float64
- func ToInt(value any) int
- func ToInt8(value any) int8
- func ToInt16(value any) int16
- func ToInt32(value any) int32
- func ToInt64(value any) int64
- func ToJsonString(value any) string
- func ToLowerFirstPrefix(dataStr string) string
- func ToMap(data any) map[string]any
- func ToString(value any) string
- func ToUInt(value any) uint
- func ToUInt8(value any) uint8
- func ToUInt16(value any) uint16
- func ToUInt32(value any) uint32
- func ToUInt64(value any) uint64
- func ToUpperFirstPrefix(dataStr string) string
- func ToValue(value any, valueKind reflect.Kind) (any, error)
- func YamlCheck(content string) error
- func YamlToJson(contentOfYaml string) (string, error)
- func YamlToList(contentOfYaml string) ([]interface{}, error)
- func YamlToMap(contentOfYaml string) (map[string]interface{}, error)
- func YamlToProperties(contentOfYaml string) (string, error)
- func YamlToPropertiesWithKey(key string, contentOfYaml string) (string, error)
- type ChangeError
- type ConvertError
- type ISCList
- type ISCMap
- type IntRange
- type Properties
- type StringPair
- type TypeEnum
- type YamlNode
Constants ¶
This section is empty.
Variables ¶
View Source
var ArrayBlanks = "- "
ArrayBlanks 数组缩进
View Source
var Dot = "."
Dot 点
View Source
var IndentBlanks = " "
IndentBlanks 缩进空格
View Source
var NewLine = "\n"
NewLine 换行符
View Source
var SignEqual = "="
SignEqual 等号连接符
View Source
var SignSemicolon = ":"
SignSemicolon 分号连接符
View Source
var YamlNewLineDom = "|\n"
NewLineDom yaml的value换行符
Functions ¶
func ArrayToObject ¶
func ArrayToObject(dataArray interface{}, targetPtrObj interface{}) error
func Base64Decode ¶
func Base64Encode ¶
func DataToObject ¶
DataToObject 其他的类型能够按照小写字母转换到对象 其他类型:
- 基本类型
- 结构体类型:转换后对象
- map类型
- 集合/分片类型
- 字符串类型:如果是json,则按照json进行转换
func DefaultBanner ¶
func DefaultBanner()
func GroupByTransform ¶
func GroupByTransform(list []T, f func(T) K, trans func(T) V) map[K][]V
func GroupByTransformTo ¶
func GroupByTransformTo(list []T, dest *map[K][]V, f func(T) K, trans func(T) V) map[K][]V
func IndexOfCondition ¶
func IsProperty ¶
func JoinToString ¶
func JoinToStringFull ¶
func JsonToYaml ¶
func LastIndexOf ¶
func LastIndexOf(list []T, item T) int
func LastIndexOfCondition ¶
func ListContains ¶
func ListContains(list []T, item T) bool
func MapAllValue ¶
func MapAnyValue ¶
func MapContains ¶
func MapContains(m map[K]V, k K, v V) bool
func MapContainsKey ¶
func MapContainsKey(m map[K]V, k K) bool
func MapContainsValue ¶
func MapContainsValue(m map[K]V, v V) bool
func MapCountKey ¶
func MapCountValue ¶
func MapFilterKeys ¶
func MapFilterKeys(m map[K]V, f func(K) bool) map[K]V
func MapFilterNot ¶
func MapFilterNot(m map[K]V, f func(K, V) bool) map[K]V
func MapFilterNotTo ¶
func MapFilterNotTo(m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V
func MapFilterTo ¶
func MapFilterTo(m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V
func MapFilterValues ¶
func MapFilterValues(m map[K]V, f func(V) bool) map[K]V
func MapNoneKey ¶
func MapNoneValue ¶
func MapToObject ¶
func MapToObject(dataMap interface{}, targetPtrObj interface{}) error
func MapToProperties ¶
进行深层嵌套的map数据处理
func ObjectToData ¶
func ObjectToData(object interface{}) interface{}
ObjectToData 字段转化,其中对应字段为小写,map的话为小写
func ObjectToJson ¶
func ObjectToJson(object interface{}) string
ObjectToJson 对象转化为json,其中map对应的key为小写
func ObjectToYaml ¶
func PropertiesEntityToYaml ¶
func PropertiesEntityToYaml(properties Properties) (string, error)
func PropertiesToMap ¶
func PropertiesToYaml ¶
func ReaderToObject ¶
func StrToObject ¶
func ToComplex64 ¶
func ToComplex128 ¶
func ToComplex128(value any) complex128
func ToJsonString ¶
func YamlToJson ¶
func YamlToList ¶
func YamlToProperties ¶
Types ¶
type ChangeError ¶
type ChangeError struct {
ErrMsg string
}
func (*ChangeError) Error ¶
func (error *ChangeError) Error() string
type ConvertError ¶
type ConvertError struct {
// contains filtered or unexported fields
}
func (*ConvertError) Error ¶
func (convertError *ConvertError) Error() string
type IntRange ¶
func MakeIntRange ¶
type Properties ¶
type StringPair ¶
func YamlToKvList ¶
func YamlToKvList(contentOfYaml string) ([]StringPair, error)
Click to show internal directories.
Click to hide internal directories.