utils

package
v0.0.0-...-e06f45f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAnyWithMap

func FormatAnyWithMap(obj any, msgMap *map[string]string) any

FormatAnyWithMap 传入指针

func FormatInterfaceWithMap

func FormatInterfaceWithMap(value reflect.Value, msgMap *map[string]string) reflect.Value

func FormatMapWithMap

func FormatMapWithMap(value reflect.Value, msgMap *map[string]string) reflect.Value

func FormatSliceWithMap

func FormatSliceWithMap(value reflect.Value, msgMap *map[string]string) reflect.Value

func FormatStringWithMap

func FormatStringWithMap(value string, msgMap *map[string]string) string

func FormatStructWithMap

func FormatStructWithMap(value reflect.Value, msgMap *map[string]string) reflect.Value

func FormatValueWithMap

func FormatValueWithMap(value reflect.Value, msgMap *map[string]string) reflect.Value

func GenerateMap

func GenerateMap(keys []string, values []string) map[string]string

func HmacSha256

func HmacSha256(data string, secret string) string

func OutputString

func OutputString(content string)

func ReadFromYaml

func ReadFromYaml(path string, target any) error

func StructToDict

func StructToDict(obj any) ext.Dict

StructToDict 需要结构体字段Tag设置为 `dict:"目标键名"` 或 `dict:"目标键名,omitempty"` 如 Text string `dict:"text,omitempty"`

func StructToJson

func StructToJson(obj any) map[string]any

StructToJson 需要结构体字段Tag设置为 `json:"目标键名"` 或 `json:"目标键名,omitempty"` 如 Text string `json:"text,omitempty"`

func ValueToString

func ValueToString(obj reflect.Value) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL