request

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeadersFromRequestContext

func GetHeadersFromRequestContext(
	ctx context.Context,
) (http.Header, error)

GetHeadersFromRequestContext tries to get the request headers from the context

Parameters:

  • ctx: The context to get the request headers from

Returns:

- http.Header: The request headers - error: If there was an error getting the request headers

Types

type DefaultInterceptor added in v0.2.1

type DefaultInterceptor struct{}

DefaultInterceptor is the default interceptor

func (DefaultInterceptor) CreateClientContextFromRequestContext added in v0.2.1

func (i DefaultInterceptor) CreateClientContextFromRequestContext(
	originalCtx context.Context, headers ...string,
) (ctx context.Context, callInfo connect.CallInfo, err error)

CreateClientContextFromRequestContext creates a client context from the request context, injecting specified headers

Parameters:

- originalCtx: the request context - headers: the headers to inject

Returns:

- context.Context: the client context - error: if there was an error creating the client context

type Injector added in v0.2.1

type Injector interface {
	CreateClientContextFromRequestContext(
		ctx context.Context, headers ...string,
	) (context.Context, error)
}

Injector is the interface that defines the methods to inject data into the request context

Jump to

Keyboard shortcuts

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