format

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EmptyString     = ""
	CommonLayout    = "2006-01-02 15:04:05"
	EmptyLen        = 0
	Zero            = 0
	MaxSize         = 2000
	DefaultPageNo   = 1
	DefaultPageSize = 20
	DefaultRetCode  = 0
	Success         = "success"
)

common constant

Variables

This section is empty.

Functions

func FromJsonString

func FromJsonString(j string, v interface{}) error

FromJsonString

func GetTraceSpanID added in v1.0.2

func GetTraceSpanID(ctx context.Context) string

func Marshal

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

Marshal 序列化,包装原生json

func Ptr added in v1.0.14

func Ptr[T any](v T) *T

Ptr returns a pointer to the provided value.

func ToJsonString

func ToJsonString(v interface{}) string

ToJsonString

func ToList added in v1.0.15

func ToList(tag string, in interface{}) [2]string

func ToMap added in v1.0.15

func ToMap(tag string, in interface{}) map[string]interface{}

func Unmarshal

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

Unmarshal 序列化,包装原生json

Types

This section is empty.

Jump to

Keyboard shortcuts

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