contextlib

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func NewContext

func NewContext(r *http.Request) *Context

func (*Context) ApplicationID

func (ctx *Context) ApplicationID() string

GetApplicationID returns the id of the application

func (Context) Deadline

func (ctx Context) Deadline() (deadline time.Time, ok bool)

Deadline returns the deadline event

func (Context) Done

func (ctx Context) Done() <-chan struct{}

Done is added to implement the interface

func (Context) Err

func (ctx Context) Err() error

Err is added to implement the interface

func (*Context) GetEmail

func (ctx *Context) GetEmail() string

GetEmail returns the email of the current user

func (*Context) GetPermission

func (ctx *Context) GetPermission() authlib.Permission

GetRoles returns the permissions of the current user

func (*Context) GetRoles

func (ctx *Context) GetRoles() authlib.Roles

GetRoles returns the roles of the current user

func (*Context) GetUserUID

func (ctx *Context) GetUserUID() (uid string)

GetUserUID returns the UID of the current user

func (*Context) Set

func (ctx *Context) Set(key, val interface{})

Set saves a key-value pair in the context

func (Context) Value

func (ctx Context) Value(key interface{}) interface{}

Value returns the context value according to the key given in parameter

Jump to

Keyboard shortcuts

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