types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentType

type ContentType int
const (
	JSON ContentType = iota
	XML
	RAW
	FormData
	EncodedFormData
	Binary
)

func (*ContentType) FromHeader

func (c *ContentType) FromHeader(header string) bool

func (*ContentType) Header

func (c *ContentType) Header() string

type ErrorCode

type ErrorCode int
const (
	SerializeBodyErrorCode ErrorCode = 2000 + iota
	ValidationErrorCode
	UnsupportedMIMETypeErrorCode
	UnMarshallErrorCode
)

type HttpClientError

type HttpClientError struct {
	ErrorCode    ErrorCode
	ErrorMessage string
	ErrorDetails error
}

func SerializeBodyError

func SerializeBodyError(err error) *HttpClientError

func UnMarshallError

func UnMarshallError(err error) *HttpClientError

func UnsupportedMIMETypeError

func UnsupportedMIMETypeError(additional string) *HttpClientError

func ValidationError

func ValidationError(attrName string) *HttpClientError

func (*HttpClientError) Error

func (e *HttpClientError) Error() string

type Query

type Query map[string]any

func (*Query) Add

func (q *Query) Add(key string, value any)

func (*Query) UrlEncode

func (q *Query) UrlEncode() (string, error)

Jump to

Keyboard shortcuts

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