echocontext

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package echocontext adds the echo context to the parent context

Index

Constants

This section is empty.

Variables

View Source
var EchoContextKey = &ContextKey{"EchoContextKey"}

EchoContextKey is the context key for the echo.Context

View Source
var (
	// ErrUnableToRetrieveEchoContext is returned when the echo context is unable to be parsed from parent context
	ErrUnableToRetrieveEchoContext = errors.New("unable to retrieve echo context")
)

Functions

func EchoContextFromContext

func EchoContextFromContext(ctx context.Context) (echo.Context, error)

EchoContextFromContext gets the echo.Context from the parent context

func EchoContextToContextMiddleware

func EchoContextToContextMiddleware() echo.MiddlewareFunc

EchoContextToContextMiddleware is the middleware that adds the echo.Context to the parent context

func NewTestContext added in v0.5.2

func NewTestContext() context.Context

func NewTestContextWithValidUser

func NewTestContextWithValidUser(subject string) (*echo.Context, error)

NewTestContextWithValidUser creates an echo context with a fake subject for testing purposes ONLY

func NewTestEchoContext

func NewTestEchoContext() echo.Context

NewTestEchoContext used for testing purposes ONLY

Types

type ContextKey

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

ContextKey is the key name for the additional context

type CustomContext

type CustomContext struct {
	echo.Context
	// contains filtered or unexported fields
}

CustomContext contains the echo.Context and request context.Context

Jump to

Keyboard shortcuts

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