contextutil

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-2.1 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MWContext

func MWContext() echo.MiddlewareFunc

MWContext is a middleware that injects custom context into echo.Context

Types

type Context

type Context interface {
	GetContext() context.Context
	AuthUser() *types.AuthUser
	RealIP() string
	UserAgent() string
}

Context is a custom context interface

func NewContext

func NewContext(c echo.Context) Context

NewContext returns new custom context

type HTTPContext

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

HTTPContext is a custom context

func (*HTTPContext) AuthUser

func (h *HTTPContext) AuthUser() *types.AuthUser

AuthUser returns authenticated user info

func (*HTTPContext) GetContext

func (h *HTTPContext) GetContext() context.Context

GetContext returns context

func (*HTTPContext) RealIP

func (h *HTTPContext) RealIP() string

RealIP returns real ip address

func (*HTTPContext) SetAuthUser

func (h *HTTPContext) SetAuthUser()

SetAuthUser sets authenticated user info

func (*HTTPContext) UserAgent

func (h *HTTPContext) UserAgent() string

UserAgent returns user agent

Jump to

Keyboard shortcuts

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