echocontext

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package echocontext adds the echo context to the parent context

Index

Constants

This section is empty.

Variables

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

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 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