Versions in this module Expand all Collapse all v1 v1.1.0 Mar 29, 2024 Changes in this version type Request + Method HTTPMethod + URI URI + type RequestDTO struct + Data []byte + Header IHeader + Method string + URI URI type Response + Request RequestDTO + func NewErrorResponse(request *http.Request, err error) (Response, error) + func (r Response) RequestBodyOrFail() (map[string]any, error) + func (r Response) RequestDTO(v any) any + func (r Response) RequestDTOorFail(v any) any v1.0.2 Mar 22, 2024 Changes in this version type Response + func (r Response) DTOorFail(v any) error + func (r Response) ResponseBody() map[string]any + func (r Response) ResponseBodyOrFail() (map[string]any, error) v1.0.1 Mar 20, 2024 Changes in this version + const ErrAuthRoomCanNotFoundKey type AuthRoom + AuthToken string type IAuth + func NewAccessTokenAuth() IAuth v1.0.0 Mar 14, 2024 Changes in this version + const TagHeader + const TagOk + const TagQueryParams + const TagStatus + const TagTime + type AccessTokenAuth struct + func (a AccessTokenAuth) Apply(connector *Connector, response Response) + type AuthRoom struct + AuthRequest *Request + AuthStrategy IAuth + func (r *AuthRoom) Send(request *Request) (Response, error) + func (r *AuthRoom) SetAuthStrategy(auth IAuth) + type Config struct + Format string + Output io.Writer + type Connector struct + Header IHeader + func NewConnector(baseUrl string, opts ...OptionConnector) *Connector + func (c *Connector) Do(request *Request) (Response, error) + func (c *Connector) Send(path string) (Response, error) + type Context struct + Cancel context.CancelFunc + Ctx context.Context + type ContextBuilder struct + func NewContextBuilder(timeout time.Duration) ContextBuilder + func (b ContextBuilder) Build() Context + type FormURLEncodedBody struct + func (f FormURLEncodedBody) Parse() *bytes.Buffer + type HTTPMethod string + const DELETE + const GET + const HEAD + const PATCH + const POST + const PUT + func (s HTTPMethod) String() string + type HTTPProtocol int + const Http + const Https + func (h HTTPProtocol) String() string + type Header struct + func (h *Header) Add(key string, value string) IHeader + func (h *Header) Get(key string) string + func (h *Header) Merge(header IHeader) IHeader + func (h *Header) Properties() store.IMap + func (h *Header) String() (str string) + type IAuth interface + Apply func(connector *Connector, response Response) + type IAuthRoom interface + Send func(request *Request) (Response, error) + SetAuthStrategy func(auth IAuth) + func NewAuthRoom(connector *Connector, auth IAuth, authRequest *Request) IAuthRoom + type IBodyParser interface + Parse func() *bytes.Buffer + func NewFormURLEncodedBodyParser(v any) IBodyParser + func NewJsonBodyParser(v any) IBodyParser + type IContextBuilder interface + Build func() Context + type IDTOFactory interface + func NewDTOFactory(contentType ...string) IDTOFactory + type IHeader interface + Add func(key string, value string) IHeader + Get func(key string) string + Merge func(header IHeader) IHeader + Properties func() store.IMap + String func() string + func NewHeader(properties ...store.IMap) IHeader + type IMapQuery struct + func (q IMapQuery) String() string + type IQuery interface + String func() string + func NewQuery(v any) IQuery + type IRoom interface + Send func(request *Request) (Response, error) + type ISend interface + Send func() Response + type IUrlQuery struct + func (q IUrlQuery) String() string + type JsonBody struct + func (f JsonBody) Parse() *bytes.Buffer + type JsonDTOFactory struct + type LogFunc func(output bytes.Buffer, response Response) (int, error) + type OptionConnector func(info *Connector) + func WithHeaderConnector(header IHeader) OptionConnector + func WithHeaderContextBuilder(ctxBuilder IContextBuilder) OptionConnector + type OptionRequest func(request *Request) + func ForceDTO() OptionRequest + func WithBody(bodyParser IBodyParser) OptionRequest + func WithContextBuilder(contextBuilder IContextBuilder) OptionRequest + func WithDTO(dto any) OptionRequest + func WithHeader(header IHeader) OptionRequest + func WithMethod(method HTTPMethod) OptionRequest + func WithQuery(query IQuery) OptionRequest + type Query struct + type Request struct + BodyParser IBodyParser + DTO any + ForceDTO bool + Header IHeader + Query IQuery + func NewRequest(path string, opts ...OptionRequest) *Request + func (r *Request) Send() (Response, error) + type Response struct + DTO any + Data []byte + Header IHeader + Method string + RequestBody map[string]any + RequestHeader IHeader + RequestURI URI + StatusCode int + func NewResponse(r *http.Response, forceDTO bool) (Response, error) + func (r Response) OK() bool + type Room struct + Connector *Connector + func NewRoom(connector *Connector) *Room + func (r *Room) Send(request *Request) (Response, error) + type URI struct + func NewURI(fullUrl string) URI + func (u URI) Authority() string + func (u URI) Path() string + func (u URI) Query() string + func (u URI) Scheme() string + func (u URI) String() string + type XMLDTOFactory struct