Help us shape the future of Go! Take the 2026 Go Developer Survey

netop

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 4 Imported by: 4

README

netop

common net operation helper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string, parameters ...RequestParam) (*http.Response, error)

Get send a GET request to server and return response or error

func GetBytes

func GetBytes(url string, parameters ...RequestParam) ([]byte, error)

GetBytes send a GET request to server and return response buffer or error

func GetString

func GetString(url string, parameters ...RequestParam) (string, error)

GetString send a GET request to server and return response string or error

Types

type Param

type Param struct {
	URL           string
	Refer         string
	Retry         int
	RetryInterval time.Duration
	// contains filtered or unexported fields
}

Param download parameters

type RequestParam

type RequestParam interface {
	// contains filtered or unexported methods
}

RequestParam defines download parameters

func Log

func Log(logChannel chan<- string) RequestParam

Log set log chan to show operation log

func Refer

func Refer(refer string) RequestParam

Refer set request refer

func Retry

func Retry(retry int, interval time.Duration) RequestParam

Retry set request retry times and interval

Jump to

Keyboard shortcuts

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