pkg

package
v0.0.0-...-ff82ded Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStruct

func ConvertStruct(source any, typ *any) (s any, err error)

ConvertStruct 将source强转为typ类型(返回值为新建typ类型对象)

func HttpGet

func HttpGet[T any](url string, args ...any) (result T, err error)

HttpGet 发送 Http Get 请求

func HttpPost

func HttpPost[T any](url string, body HttpBody, args ...any) (result T, err error)

HttpPost 发送 Http Post 请求

func HttpRequest

func HttpRequest[T any](url string, args ...any) (result T, err error)

HttpRequest 发送 Http 请求 第一个参数为请求地址

Types

type HttpBody

type HttpBody interface{}

HttpBody Post 请求主体

type HttpHeader

type HttpHeader map[string]string

HttpHeader 请求Header

type HttpMethod

type HttpMethod string
const (
	HttpMethodGet  HttpMethod = "GET"
	HttpMethodPost HttpMethod = "POST"
)

type HttpParams

type HttpParams map[string]string

HttpParams Get 请求参数

Jump to

Keyboard shortcuts

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