extn

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CtxAuthorizationKey = CtxKey("Authorization")
View Source
const CtxCorrelationIdKey = CtxKey("x-correlation-id")
View Source
const CtxSignedHeadersKey = CtxKey("x-signed-headers")
View Source
const CtxSystemPeerKey = CtxKey("x-system-peer")

Variables

This section is empty.

Functions

func Client

func Client(logger log.Logger) middleware.Middleware

Client is a client logging middleware.

func ClientCorrelationIdInjector

func ClientCorrelationIdInjector() middleware.Middleware

func DoPost

func DoPost[T any](ctx context.Context, hc *khttp.Client, url string, headers map[string]string, body io.Reader, responseType T) (T, error)

func MakeHTTPRequest

func MakeHTTPRequest[T any](ctx context.Context, hc *khttp.Client, fullUrl string, httpMethod string, headers map[string]string, queryParameters url.Values, body io.Reader, responseType T) (T, error)

in the case of GET, the parameter queryParameters is transferred to the URL as query parameters in the case of POST, the parameter body, an io.Reader, is used

func NewHttpClient

func NewHttpClient(ctx context.Context, endpoint string, logger log.Logger) (*khttp.Client, error)

func Server

func Server(logger log.Logger) middleware.Middleware

Server is an server logging middleware.

func ServerCorrelationIdInjector

func ServerCorrelationIdInjector() middleware.Middleware

func ServerSecurityHeaderValidator

func ServerSecurityHeaderValidator() middleware.Middleware

Types

type CtxKey

type CtxKey string

type Redacter added in v0.1.3

type Redacter interface {
	Redact() string
}

Jump to

Keyboard shortcuts

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