common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel2Snake

func Camel2Snake(s string) string

func GetParamOrStdin

func GetParamOrStdin() string

func JsonToForm

func JsonToForm(data []byte) (url.Values, error)

func LazyLoad

func LazyLoad[T any](getter func() *T) func() *T

func MD5

func MD5(source string) string

func ReadStdin

func ReadStdin() <-chan string

func RunCmd

func RunCmd(ctx context.Context, cmd string, args ...string) ([]byte, []byte, error)

func Snake2Camel

func Snake2Camel(s string, bigCamel bool) string

func Str

func Str(v interface{}) string

func ToNum

func ToNum(v interface{}) int

func UnsafeMarshal

func UnsafeMarshal(v interface{}) string

Types

type CommonRsp

type CommonRsp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type Empty

type Empty struct{}

type Paging

type Paging struct {
	PageNo   int `json:"page_no"` //从1开始
	PageSize int `json:"page_size"`
}

func (Paging) Limit

func (p Paging) Limit() int

func (Paging) Offset

func (p Paging) Offset() int

type Pair

type Pair struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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