api

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTextPlain              = "text/plain"
	CApplicationJSON        = "application/json"
	CApplicationOctetStream = "application/octet-stream"
)

Variables

View Source
var (
	ErrBadStatusCode = &SApiError{"bad status code"}
	ErrReadResponse  = &SApiError{"read response"}
	ErrLoadResponse  = &SApiError{"load response"}
	ErrBadRequest    = &SApiError{"bad request"}
	ErrBuildRequest  = &SApiError{"build request"}
	ErrCopyBytes     = &SApiError{"copy bytes"}
)

Functions

func Request

func Request(
	pCtx context.Context,
	pClient *http.Client,
	pMethod, pURL string,
	pData interface{},
) ([]byte, error)

func Response

func Response(pW http.ResponseWriter, pRet int, pRes interface{}) error

Types

type SApiError added in v1.6.8

type SApiError struct {
	// contains filtered or unexported fields
}

func (*SApiError) Error added in v1.6.8

func (err *SApiError) Error() string

Jump to

Keyboard shortcuts

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