ctx

package
v0.0.0-...-5293aea Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpHeaderAuthorization = convAuth.HttpHeaderAuthorization
	HttpHeaderWorkflow      = "Workflow"
	HTTPHeaderTimeNow       = "Time-Now"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent string

type Context

type Context struct {
	context.Context
}

func New

func New(claims convAuth.Claims) (ctx Context)

func WrapContext

func WrapContext(parent context.Context, claims convAuth.Claims) (ctx Context)

func (Context) Action

func (ctx Context) Action() convAuth.Action

func (Context) Agent

func (ctx Context) Agent() Agent

func (Context) Claims

func (ctx Context) Claims() (claims convAuth.Claims)

func (Context) Environment

func (ctx Context) Environment() Environment

func (Context) Exit

func (ctx Context) Exit(errPtr *error)

Indicate the current context exits and wrapped eventual error with the current scope

func (Context) IsProdEnv

func (ctx Context) IsProdEnv() bool

func (Context) LogError

func (ctx Context) LogError(v any)

func (Context) LogErrorf

func (ctx Context) LogErrorf(format string, a ...any)

func (Context) LogInfo

func (ctx Context) LogInfo(v any)

func (Context) LogInfof

func (ctx Context) LogInfof(format string, a ...any)

func (Context) LogTrace

func (ctx Context) LogTrace(w http.ResponseWriter, r *http.Request, handle func(w http.ResponseWriter, r *http.Request))

func (Context) LogWarn

func (ctx Context) LogWarn(v any)

func (Context) LogWarnf

func (ctx Context) LogWarnf(format string, a ...any)

func (Context) Now

func (ctx Context) Now() time.Time

func (Context) Request

func (ctx Context) Request() (r *http.Request)

func (Context) Scope

func (ctx Context) Scope() string

func (Context) User

func (ctx Context) User() auth.User

func (Context) WithAgentClaims

func (ctx Context) WithAgentClaims() Context

func (Context) WithClaims

func (ctx Context) WithClaims(claims convAuth.Claims) Context

func (Context) WithRequest

func (ctx Context) WithRequest(r *http.Request) (res Context)

func (Context) WithScope

func (ctx Context) WithScope(scope string) Context

func (Context) WithScopef

func (ctx Context) WithScopef(format string, a ...any) Context

func (Context) Workflow

func (ctx Context) Workflow() Workflow

type Environment

type Environment string
const (
	EnvironmentProduction Environment = "production"
)

type Workflow

type Workflow string

Jump to

Keyboard shortcuts

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