http

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidResponse = fmt.Errorf("invalid response")
)

Functions

func CopyReader

func CopyReader(r io.Reader) (io.ReadSeekCloser, error)

func NewReader

func NewReader(p []byte) io.ReadSeekCloser

func Request

func Request(req *http.Request, cfg Config, service string) error

func Response

func Response(rsp *http.Response, model any) error

Types

type Config

type Config interface {
	GetRegion() string
	GetAccessKey() string
	GetSecretKey() string
}

type ErrorResponse

type ErrorResponse struct {
	XMLName   xml.Name `xml:"Error"`
	Code      string   `xml:"Code" json:"code"`
	Message   string   `xml:"Message" json:"message"`
	RequestID string   `xml:"RequestId" json:"requestId"`
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type ErrorStatus

type ErrorStatus struct {
	Status  string `xml:"Code" json:"code"`
	Message string `xml:"Message" json:"message"`
}

func (ErrorStatus) Error

func (e ErrorStatus) Error() string

Jump to

Keyboard shortcuts

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