core

package
v1.7.0-preview20240414 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorMapping

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

type HttpMethod

type HttpMethod int //nolint:stylecheck

Represents the HTTP method used by a request.

const (
	// The HTTP GET method.
	GET HttpMethod = iota
	// The HTTP POST method.
	POST
	// The HTTP PATCH method.
	PATCH
	// The HTTP DELETE method.
	DELETE
	// The HTTP OPTIONS method.
	OPTIONS
	// The HTTP CONNECT method.
	CONNECT
	// The HTTP PUT method.
	PUT
	// The HTTP TRACE method.
	TRACE
	// The HTTP HEAD method.
	HEAD
)

func (HttpMethod) String

func (m HttpMethod) String() string

String returns the string representation of the HTTP method.

type RequestBuilder

type RequestBuilder interface {
	SendDelete2(config *RequestConfiguration) error
	SendGet2(config *RequestConfiguration) error
	SendPost3(config *RequestConfiguration) error
	SendPut2(config *RequestConfiguration) error
	ToDeleteRequestInformation(params interface{}) (*RequestInformation, error)
	ToDeleteRequestInformation2(config *RequestConfiguration) (*RequestInformation, error)
	ToGetRequestInformation(params interface{}) (*RequestInformation, error)
	ToGetRequestInformation2(config *RequestConfiguration) (*RequestInformation, error)
	ToHeadRequestInformation() (*RequestInformation, error)
	ToPostRequestInformation(data map[string]string, params interface{}) (*RequestInformation, error)
	ToPostRequestInformation2(data interface{}, params interface{}) (*RequestInformation, error)
	ToPostRequestInformation3(config interface{}) (*RequestInformation, error)
	ToPutRequestInformation(data map[string]string, params interface{}) (*RequestInformation, error)
	ToPutRequestInformation2(config interface{}) (*RequestInformation, error)
	ToRequestInformation(method HttpMethod, data map[string]string, params interface{}) (*RequestInformation, error)
	ToRequestInformation2(method HttpMethod, rawData interface{}, params interface{}) (*RequestInformation, error)
	ToRequestInformation3(method HttpMethod, config *interface{}) (*RequestInformation, error)
}

type RequestConfiguration

type RequestConfiguration struct {
	Header          interface{}
	QueryParameters interface{}
	Data            interface{}
	ErrorMapping    ErrorMapping
	Response        Response
}

type RequestHeader

type RequestHeader interface {
	Set(key, value string)
	Get(key string) string
	SetAll(headers http.Header)
	Iterate(callback func(string, []string) bool)
}

type RequestInformation

type RequestInformation interface {
	SetStreamContent(content []byte)
	GetContent() []byte
	GetMethod() string
	GetHeaders() 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 RequestOption

type RequestOption interface {
	// GetKey returns the key to store the current option under.
	GetKey() RequestOptionKey
}

Represents a request option.

type RequestOptionKey

type RequestOptionKey struct {
	// The unique key for the option.
	Key string
}

RequestOptionKey represents a key to store a request option under.

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