nethttp

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TenantKey is the key that holds the tenant in a request context.
	TenantKey = mw.NetHTTPTenantKey

	// DefaultSkipper defines the default skipper function.
	DefaultSkipper = mw.DefaultSkipper
	// DefaultTenantGetters represents the default tenant getters
	DefaultTenantGetters = mw.DefaultTenantGetters
)

Functions

func ContextWithTenant

func ContextWithTenant(ctx context.Context, tenant string) context.Context

ContextWithTenant sets the tenant in the request context

func TenantFromContext

func TenantFromContext(ctx context.Context) (string, error)

TenantFromContext retrieves the tenant from the request context

func WithTenant

func WithTenant(config WithTenantConfig) func(next http.Handler) http.Handler

WithTenant creates new middleware which sets the tenant in the request context

Types

type WithTenantConfig

type WithTenantConfig = mw.WithTenantConfig

WithTenantConfig defines the config for WithTenant middleware.

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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