encode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(base64Str string) ([]byte, error)

Base64Decode decode base64 string to utf8 string

func Base64Encode

func Base64Encode(strByte []byte) string

Base64Encode encode []byte to base64 string

func IsJSON

func IsJSON(s string) bool

IsJosn check if a string is json string

func JSONDecodeToStruct

func JSONDecodeToStruct(data []byte, v interface{}) error

JSONDecodeToStruct decode json to struct v is a struct pointer = &Stru{} struct field name 必須大寫開頭且名稱跟json相同

func JSONEncodeFromStruct

func JSONEncodeFromStruct(v interface{}) ([]byte, error)

JSONEncodeFromStruct encode struct to json string

func StructToMap

func StructToMap(v interface{}) (map[string]interface{}, error)

StructToMap decode struct to map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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