current

package
v0.0.0-...-a8d7ca2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(ctx context.Context) *model.User

GetUser returns the current user from context.

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware initializes the custom context.

func SetUser

func SetUser(ctx context.Context, user *model.User)

SetUser stores the current user within context.

Types

type Context

type Context struct {
	Keys map[string]any
	// contains filtered or unexported fields
}

Context defines a custom writeable context.

func (*Context) Get

func (c *Context) Get(key string) (any, bool)

Get is used to read from the contenxt.

func (*Context) Set

func (c *Context) Set(key string, value any)

Set is used to write to the context.

Jump to

Keyboard shortcuts

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