http

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MaxIdleConns          int    = 100
	MaxIdleConnsPerHost   int    = 100
	IdleConnTimeout       int    = 90
	ContentTypeJson       string = "application/json; charset=utf-8"
	ContentTypeHtml       string = "text/html; charset=utf-8"
	ContentTypeText       string = "text/plain; charset=utf-8"
	ContentTypeCss        string = "text/css; charset=utf-8"
	ContentTypeJavaScript string = "application/x-javascript; charset=utf-8"
	ContentTypeJpeg       string = "image/jpeg"
	ContentTypePng        string = "image/png"
	ContentTypeGif        string = "image/gif"
	ContentTypeAll        string = "*/*"
)

Variables

This section is empty.

Functions

func Delete

func Delete(url string, header http.Header, parameterMap map[string]string) ([]byte, error)

func DeleteOfStandard

func DeleteOfStandard(url string, header http.Header, parameterMap map[string]string) ([]byte, error)

func DeleteSimple

func DeleteSimple(url string) ([]byte, error)

func DeleteSimpleOfStandard

func DeleteSimpleOfStandard(url string) ([]byte, error)

func Get

func Get(url string, header http.Header, parameterMap map[string]string) ([]byte, error)

func GetOfStandard

func GetOfStandard(url string, header http.Header, parameterMap map[string]string) ([]byte, error)

func GetSimple

func GetSimple(url string) ([]byte, error)

func GetSimpleOfStandard

func GetSimpleOfStandard(url string) ([]byte, error)
func Head(url string, header http.Header, parameterMap map[string]string) error

func HeadSimple

func HeadSimple(url string) error

func Patch

func Patch(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PatchOfStandard

func PatchOfStandard(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PatchSimple

func PatchSimple(url string, body interface{}) ([]byte, error)

func PatchSimpleOfStandard

func PatchSimpleOfStandard(url string, body interface{}) ([]byte, error)

func Post

func Post(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PostOfStandard

func PostOfStandard(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PostSimple

func PostSimple(url string, body interface{}) ([]byte, error)

func PostSimpleOfStandard

func PostSimpleOfStandard(url string, body interface{}) ([]byte, error)

func Put

func Put(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PutOfStandard

func PutOfStandard(url string, header http.Header, parameterMap map[string]string, body interface{}) ([]byte, error)

func PutSimple

func PutSimple(url string, body interface{}) ([]byte, error)

func PutSimpleOfStandard

func PutSimpleOfStandard(url string, body interface{}) ([]byte, error)

func SetHttpClient

func SetHttpClient(httpClientOuter *http.Client)

Types

type DataResponse

type DataResponse[T any] struct {
	ResponseBase
	Data T `json:"data"`
}

type NetError

type NetError struct {
	ErrMsg string
}

func (*NetError) Error

func (error *NetError) Error() string

type PagedData

type PagedData[T any] struct {
	Total         int64 `json:"total"`
	Size          int64 `json:"size"`
	Current       int64 `json:"current"`
	IsSearchCount bool  `json:"isSearchCount"`
	Records       []T   `json:"records"`
}

type PagedResponse

type PagedResponse[T any] struct {
	ResponseBase
	Data PagedData[T] `json:"data"`
}

type ResponseBase

type ResponseBase struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type StandardResponse

type StandardResponse struct {
	Code    interface{} `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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