context

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 11 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 {
	ReqUser    *models.User
	GinContext *gin.Context

	// DisableResponses is mainly used for the graphql routes because the library handles error messages and we don't want to return custom errors
	DisableResponses bool
	// contains filtered or unexported fields
}

Context is a global request context

func GetContext

func GetContext(c *gin.Context) *Context

func (*Context) Clone

func (c *Context) Clone() *Context

func (*Context) GetDB

func (c *Context) GetDB() *gorm.DB

func (*Context) GetUser

func (c *Context) GetUser(ctx context.Context) (*models.User, error)

func (*Context) LogErr

func (c *Context) LogErr(err error, meta ...map[string]interface{})

func (*Context) SetLoggingMetaValue

func (c *Context) SetLoggingMetaValue(key string, value interface{})

Jump to

Keyboard shortcuts

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