global

package
v0.0.0-...-9b6d7a9 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Addr            string
	SensitiveWords  []string
	MessageQueueLen = 1024
	TokenSecret     string
)
View Source
var (
	RootDir string
)

Functions

func Init

func Init()

func Json2Struct

func Json2Struct(src string, dst interface{}) error

Json2Struct 参数dst必须是指针

func ProcessSensitiveData

func ProcessSensitiveData(dst, src interface{}) interface{}

ProcessSensitiveData 数据脱敏 结构体转结构体

func Struct2Json

func Struct2Json(src interface{}) string

func Struct2Struct

func Struct2Struct(src, dst interface{})

Struct2Struct struct转struct 一般通过json tag进行比较转换,因此可以通过struct,json互转实现

Types

type UserResponse

type UserResponse struct {
	UID      int       `json:"uid"`
	Nickname string    `json:"nickname"`
	EnterAt  time.Time `json:"enter_at"`
	Addr     string    `json:"addr"`
}

Jump to

Keyboard shortcuts

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