http

package
v1.7.0-preview20241117 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationHandler

type AuthorizationHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewAuthorizationHandler

func NewAuthorizationHandler(provider AuthorizationProvider) *AuthorizationHandler

func (*AuthorizationHandler) Handle

func (a *AuthorizationHandler) Handle(request RequestInformation) error

type AuthorizationProvider

type AuthorizationProvider interface {
	AuthorizeRequest(request RequestInformation) error
}

type BaseHandler

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

func NewBaseHandler

func NewBaseHandler() *BaseHandler

func (*BaseHandler) Handle

func (b *BaseHandler) Handle(request RequestInformation) error

func (*BaseHandler) Next

func (b *BaseHandler) Next() RequestHandler

func (*BaseHandler) SetNext

func (b *BaseHandler) SetNext(handler RequestHandler)

SetNext method for BaseHandler

type Client2

type Client2 interface {
	ClientSendable
	Send(RequestInformation, ErrorMapping) (*http.Response, error)
	GetBaseURL() string
}

Client2 interface designed to match core.Client2

func NewClient2CompatibleRequestAdapter

func NewClient2CompatibleRequestAdapter() Client2

type ClientSendable

type ClientSendable interface {
	SendWithContext(context.Context, RequestInformation, ErrorMapping) (*http.Response, error)
}

type ErrorMapping

type ErrorMapping interface {
	Set(code, err string)
	Len() int
	Get(code int) (string, bool)
}

type RequestAdapter

type RequestAdapter interface {
	Send(ctx context.Context, info RequestInformation) (*http.Response, error)
	AddHandler(handler RequestHandler) error
	GetBaseURL() string
}

func NewRequestAdapter

func NewRequestAdapter() RequestAdapter

type RequestBody

type RequestBody map[string]interface{}

RequestBody is a type alias for http request bodies

type RequestHandler

type RequestHandler interface {
	Handle(RequestInformation) error
	SetNext(RequestHandler)
	Next() RequestHandler
}

type RequestInformation

type RequestInformation interface {
	SetStreamContent(content []byte)
	GetContent() []byte
	GetMethod() string
	GetHeaders() core.RequestHeader
	AddQueryParameters(source interface{}) error
	SetUri(url *url.URL)
	Url() (string, error)
	ToRequest() (*http.Request, error)
	ToRequestWithContext(ctx context.Context) (*http.Request, error)
	AddHeaders(rawHeaders interface{}) error
}

type Response

type Response interface {
	ParseHeaders(headers http.Header)
}

Response represents all possible responses

Jump to

Keyboard shortcuts

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