httper

package
v0.4.3-alpha1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = time.Second * 30
View Source
var UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"

Functions

func CreateConfig added in v0.4.2

func CreateConfig(data map[string]string, name, t string) error

func DeleteConfigByName added in v0.4.2

func DeleteConfigByName(name string) error

func Get

func Get(url string, head map[string]string) (response string)

发送GET请求 url:请求地址 response:请求返回的内容

func GetConfigByName added in v0.4.2

func GetConfigByName(name string) (map[string]string, error)

func Mount added in v0.4.2

func Mount(mountPoint string, fs string) error

func NewRestyClient added in v0.4.2

func NewRestyClient() *resty.Client

func OasisGet

func OasisGet(url string) (response string)

发送GET请求 url:请求地址 response:请求返回的内容

func PersonGet added in v0.3.1

func PersonGet(url string) (response string)

发送GET请求 url:请求地址 response:请求返回的内容

func Post

func Post(url string, data []byte, contentType string, head map[string]string) (content string)

发送POST请求 url:请求地址,data:POST请求提交的数据,contentType:请求体格式,如:application/json content:请求放回的内容

func Unmount added in v0.4.2

func Unmount(mountPoint string) error

func ZeroTierGet

func ZeroTierGet(url string, head map[string]string) (content string, code int)

发送POST请求 url:请求地址,data:POST请求提交的数据,contentType:请求体格式,如:application/json content:请求放回的内容

Types

type MountList added in v0.4.2

type MountList struct {
	MountPoints []MountPoints `json:"mountPoints"`
}

func GetMountList added in v0.4.2

func GetMountList() (MountList, error)

type MountPoint added in v0.4.2

type MountPoint struct {
	MountPoint string `json:"mount_point"`
	Fs         string `json:"fs"`
	Icon       string `json:"icon"`
	Name       string `json:"name"`
}

type MountPoints added in v0.4.3

type MountPoints struct {
	MountPoint string `json:"MountPoint"`
	Fs         string `json:"Fs"`
	Icon       string `json:"Icon"`
	Name       string `json:"Name"`
}

type MountResult added in v0.4.2

type MountResult struct {
	Error string `json:"error"`
	Input struct {
		Fs         string `json:"fs"`
		MountPoint string `json:"mountPoint"`
	} `json:"input"`
	Path   string `json:"path"`
	Status int    `json:"status"`
}

type RemotesResult added in v0.4.2

type RemotesResult struct {
	Remotes []string `json:"remotes"`
}

func GetAllConfigName added in v0.4.2

func GetAllConfigName() (RemotesResult, error)

Jump to

Keyboard shortcuts

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