util

package
v0.0.0-...-0b9d03a Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 16 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

func DebugJSON(data interface{})

DebugJSON debug

func DebugSave

func DebugSave(data interface{})

DebugSave write data to temperory file

func GetBody

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

GetBody read body

func GetJSONBody

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

GetJSONBody read json body

func IsURL

func IsURL(str string) bool

IsURL returns true if a given string is an url

func PostBody

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 SetRCPC

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

GetBody read body

func YesOrNo

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