util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CHA = "abcdefghijklmnopqrstuvwxyz0123456789"

CHA map

Variables

This section is empty.

Functions

func ChooseIndex

func ChooseIndex(maxLen int) int

ChooseIndex return valid index in [0, maxLen)

func DebugJSON added in v1.0.0

func DebugJSON(data interface{})

DebugJSON debug

func DebugSave added in v0.9.0

func DebugSave(data interface{})

DebugSave write data to temperory file

func GetBody added in v1.0.0

func GetBody(client *http.Client, URL string) ([]byte, error)

GetBody read body

func GetJSONBody added in v1.0.0

func GetJSONBody(client *http.Client, url string) (map[string]interface{}, error)

GetJSONBody read json body

func IsURL added in v1.0.0

func IsURL(str string) bool

IsURL returns true if a given string is an url

func PostBody added in v1.0.0

func PostBody(client *http.Client, URL string, data url.Values) ([]byte, error)

PostBody read post body

func RandString

func RandString(n int) string

RandString n is the length. a-z 0-9

func Scanline

func Scanline() string

Scanline scan line

func ScanlineTrim

func ScanlineTrim() string

ScanlineTrim scan line and trim

func YesOrNo added in v0.5.0

func YesOrNo(note string) bool

YesOrNo must choose one

Types

This section is empty.

Jump to

Keyboard shortcuts

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