util

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepSearch

func DeepSearch(m map[string]interface{}, path []string) map[string]interface{}

DeepSearch scans deep maps, following the key indexes listed in the

func Ensure

func Ensure(err error)

Ensure defined

func EnsureLeft

func EnsureLeft(left interface{}, err error) interface{}

EnsureLeft defined return left

func EnsureRight

func EnsureRight(err error, right interface{}) interface{}

EnsureRight defined return right

func JoinObject

func JoinObject(arr interface{}, format ...string) (str string)

JoinObject defined TODO

func JsonCheck

func JsonCheck(req *http.Request) bool

JsonCheck defined TODO

func LastChar

func LastChar(str string) uint8

LastChar defined

func QueryCheck added in v1.2.3

func QueryCheck(req *http.Request) bool

QueryCheck defined TODO

func RandString

func RandString(randLen int, randType RandType) string

RandString defined random char

func RandomInt

func RandomInt(min, max int) int

RandomInt generates a random int, based on a min and max values

func SetFormatter

func SetFormatter(isTerminal bool)

SetFormatter defined

func SomeOne

func SomeOne(srv interface{}, def interface{}) interface{}

SomeOne defined

func UserHomeDir

func UserHomeDir() string

UserHomeDir defined

Types

type M

type M map[string]interface{}

M defined

type RandType

type RandType int

RandType defined rand type

const (
	RandNum RandType = iota
	RandNumUperChar
	RandNumChar
)

RandType defined

Directories

Path Synopsis
Package http is used as http.Client Usage: b := http.Post("http://.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str)
Package http is used as http.Client Usage: b := http.Post("http://.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str)
uri

Jump to

Keyboard shortcuts

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