common

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clients

func Clients(e echo.Context) *clients

func Cookies

func Cookies(ctx echo.Context) *cookies

func GrpcClientConn

func GrpcClientConn(e echo.Context) *grpc.ClientConn

GrpcClientConn creates a gRPC client connection.

func JWT

func JWT(c echo.Context) *jwtMdw

func NewJWTControllerToken

func NewJWTControllerToken(handle, address, origin string) *jwt.Token

func Partial

func Partial(cmp templ.Component) echo.HandlerFunc

Partial renders a templ.Component

func Render

func Render(c echo.Context, cmp templ.Component) error

Render renders a templ.Component

func Requests

func Requests(c echo.Context) requests

func UseDefaults

func UseDefaults(e *echo.Echo)

UseDefaults adds chi provided middleware libraries to the router.

func UseHTMX

func UseHTMX(next echo.HandlerFunc) echo.HandlerFunc

UseHTMX sets the htmx request header as context value

func UseHyperView

func UseHyperView(next echo.HandlerFunc) echo.HandlerFunc

Use HyperView sets the htmx request header as context value

func UseJWTController

func UseJWTController(address, handle, origin string) echo.MiddlewareFunc

UseJWTController returns a middleware that uses JWT for session management

func UseSessionID

func UseSessionID() echo.MiddlewareFunc

UseSessionID sets the session id cookie as middleware function

Types

type HeaderKey

type HeaderKey string

HeaderKey is the key for the htmx request header

const HTMXHeaderKey HeaderKey = "htmx-request-header"

HTMXHeaderKey is the key for the htmx request header

type JwtControllerClaims

type JwtControllerClaims struct {
	Handle  string `json:"handle"`
	Address string `json:"address"`
	Origin  string `json:"origin"`
	jwt.RegisteredClaims
}

JwtControllerClaims is a custom claims type for the JWT middleware

Jump to

Keyboard shortcuts

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