cctx

package
v0.19.1122 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigContextNotFound error = fmt.Errorf("config context not found")
View Source
var ErrMetricContextNotFound error = fmt.Errorf("metric context not found")

Functions

func AccountFromContext

func AccountFromContext(ctx ValueContext) (*app.Account, error)

func AccountFromGinContext

func AccountFromGinContext(ctx *gin.Context) (*app.Account, error)

func AccountIDFromContext

func AccountIDFromContext(ctx ValueContext) (string, error)

func ConfigFromContext

func ConfigFromContext(ctx ValueContext) (*internal.Config, error)

func ContextFromWorkflowContext

func ContextFromWorkflowContext(ctx context.Context, wCtx workflow.Context) context.Context

Copy all known context fields from a workflow context, into a regular context

func GetLogStreamContext

func GetLogStreamContext(ctx ValueContext) (*app.LogStream, error)

func GetLogStreamIDWorkflow

func GetLogStreamIDWorkflow(ctx ValueContext) (string, error)

func GetLogStreamWorkflow

func GetLogStreamWorkflow(ctx ValueContext) (*app.LogStream, error)

func GetLogger

func GetLogger(ctx ValueContext, l *zap.Logger) *zap.Logger

func IsEmployeeFromContext

func IsEmployeeFromContext(ctx ValueContext) (bool, error)

func IsGlobal

func IsGlobal(ctx *gin.Context) bool

func IsPublic

func IsPublic(ctx *gin.Context) bool

func OffsetPaginationFromContext

func OffsetPaginationFromContext(ctx ValueContext) *pagination.PaginationQuery

func OrgFromContext

func OrgFromContext(ctx ValueContext) (*app.Org, error)

func OrgIDFromContext

func OrgIDFromContext(ctx ValueContext) (string, error)

func PatcherFromContext

func PatcherFromContext(ctx ValueContext) *patcher.Patcher

func RunnerFromContext

func RunnerFromContext(ctx ValueContext) (*app.Runner, error)

func RunnerIDFromContext

func RunnerIDFromContext(ctx ValueContext) (string, error)

func SetAPILoggerFields

func SetAPILoggerFields(ctx *gin.Context, fields []zap.Field)

func SetAccountContext

func SetAccountContext(ctx context.Context, acct *app.Account) context.Context

func SetAccountGinContext

func SetAccountGinContext(ctx *gin.Context, acct *app.Account)

func SetAccountIDContext

func SetAccountIDContext(ctx context.Context, acctID string) context.Context

func SetAccountIDGinContext

func SetAccountIDGinContext(ctx *gin.Context, acctID string)

func SetAccountIDWorkflowContext

func SetAccountIDWorkflowContext(ctx workflow.Context, acctID string) workflow.Context

func SetConfigGinContext

func SetConfigGinContext(ctx *gin.Context, cfg *internal.Config)

func SetFlowInstallIDContext added in v0.19.1075

func SetFlowInstallIDContext(ctx context.Context, id string) context.Context

func SetFlowWorkflowIDContext added in v0.19.1075

func SetFlowWorkflowIDContext(ctx context.Context, id string) context.Context

func SetIsEmployeeContext

func SetIsEmployeeContext(ctx context.Context, isEmployee bool) context.Context

func SetIsEmployeeWorkflowContext

func SetIsEmployeeWorkflowContext(ctx workflow.Context, isEmployee bool) workflow.Context

func SetIsGlobal

func SetIsGlobal(ctx *gin.Context, val bool)

func SetLogStreamContext

func SetLogStreamContext(ctx context.Context, ls *app.LogStream) context.Context

func SetLogStreamWorkflowContext

func SetLogStreamWorkflowContext(ctx workflow.Context, ls *app.LogStream) workflow.Context

func SetOffPaginationGinCtx

func SetOffPaginationGinCtx(ctx *gin.Context, pagination pagination.PaginationQuery)

func SetOrgContext

func SetOrgContext(ctx context.Context, org *app.Org) context.Context

func SetOrgGinContext

func SetOrgGinContext(ctx *gin.Context, org *app.Org)

func SetOrgIDContext

func SetOrgIDContext(ctx context.Context, orgID string) context.Context

func SetOrgIDGinContext

func SetOrgIDGinContext(ctx *gin.Context, orgID string)

func SetOrgIDWorkflowContext

func SetOrgIDWorkflowContext(ctx workflow.Context, orgID string) workflow.Context

func SetPatcherGinCtx

func SetPatcherGinCtx(ctx *gin.Context, patcher patcher.Patcher)

func SetPublicContext

func SetPublicContext(ctx *gin.Context, val bool)

func SetRunnerContext

func SetRunnerContext(ctx context.Context, runner *app.Runner) context.Context

func SetRunnerGinContext

func SetRunnerGinContext(ctx *gin.Context, runner *app.Runner)

func SetRunnerIDContext

func SetRunnerIDContext(ctx context.Context, runnerID string) context.Context

func SetRunnerIDGinContext

func SetRunnerIDGinContext(ctx *gin.Context, runnerID string)

func SetTraceIDContext

func SetTraceIDContext(ctx context.Context, traceID string) context.Context

func SetTraceIDGinContext

func SetTraceIDGinContext(ctx *gin.Context, traceID string)

func SetTraceIDWorkflowContext

func SetTraceIDWorkflowContext(ctx workflow.Context, traceID string) workflow.Context

func SetWorkflowLoggerContext

func SetWorkflowLoggerContext(ctx workflow.Context, fields []zap.Field) workflow.Context

func TraceIDFromContext

func TraceIDFromContext(ctx ValueContext) string

func WorkflowContextFromContext

func WorkflowContextFromContext(wCtx workflow.Context, ctx ValueContext) workflow.Context

Copy all known context fields from a workflow context, into a workflow context

Types

type MetricContext

type MetricContext struct {
	Endpoint   string
	Method     string
	RequestURI string
	OrgID      string
	RunnerID   string
	Context    string
	Namespace  string

	IsPanic      bool
	IsTimeout    bool
	IsDeprecated bool

	SignalType string

	DBType          string
	DBOperationType string
	DBQueryCount    int
}

func MetricsContextFromGinContext

func MetricsContextFromGinContext(ctx ValueContext) (*MetricContext, error)

type ValueContext

type ValueContext interface {
	Value(any) any
}

ValueContext expresses only the read-only Value method of stdlib contexts, allowing any of stdlib, gin, or temporal contexts to be provided for functions that only need to retrieve values from a context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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