Documentation
¶
Index ¶
- Variables
- type Context
- func AsRequestContext(echoCtx *echo.Context) (Context, error)
- func CloneRequestContext(ctx Context) Context
- func NewRequestContext(ctx context.Context) Context
- func NewRequestContextF(ctx context.Context, moduleName string, domainConstraints dmodel.DynamicFields) Context
- func NewRequestContextM(ctx context.Context, moduleName string) Context
- type ContextPermissions
- type RequestContext
- func (this RequestContext) GetDbTranx() db.DbTransaction
- func (this RequestContext) GetDomainConstraints() dmodel.DynamicFields
- func (this RequestContext) GetLogger() logging.LoggerService
- func (this RequestContext) GetModuleName() string
- func (this RequestContext) GetPermissions() ContextPermissions
- func (this RequestContext) GetUser() dmodel.DynamicFields
- func (this RequestContext) InnerContext() context.Context
- func (this *RequestContext) SetDbTranx(trx db.DbTransaction)
- func (this *RequestContext) SetDomainConstraints(constraints dmodel.DynamicFields)
- func (this *RequestContext) SetLogger(logger logging.LoggerService)
- func (this *RequestContext) SetPermissions(permissions ContextPermissions)
- func (this *RequestContext) SetUser(user dmodel.DynamicFields)
- func (this *RequestContext) Value(key any) any
- func (this *RequestContext) WithValue(key, val any)
Constants ¶
This section is empty.
Variables ¶
View Source
var CtxKeyDomainConstraints = contextKey{"domain_constraints"}
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
context.Context
InnerContext() context.Context
GetLogger() logging.LoggerService
SetLogger(logger logging.LoggerService)
GetDbTranx() db.DbTransaction
SetDbTranx(trx db.DbTransaction)
GetDomainConstraints() dmodel.DynamicFields
SetDomainConstraints(constraints dmodel.DynamicFields)
GetModuleName() string
GetPermissions() ContextPermissions
SetPermissions(permissions ContextPermissions)
GetUser() dmodel.DynamicFields
SetUser(user dmodel.DynamicFields)
// Replace current inner context with a new one that has the given key and value.
WithValue(key, val any)
}
func AsRequestContext ¶
Returns pointer to an instance of RequestContext if it exists, otherwise returns an error.
func CloneRequestContext ¶
func NewRequestContext ¶
func NewRequestContextF ¶
type ContextPermissions ¶
type ContextPermissions struct {
IsOwner bool
Entitlements ds.Set[string]
UserId model.Id `json:"user_id"`
// The orgs that user belongs to (if any)
UserOrgIds ds.Set[model.Id] `json:"user_org_ids"`
// The org unit that user belongs to (if any)
OrgUnitId *model.Id `json:"org_unit_id"`
// The org that the org unit belongs to (if user belongs to an org unit)
OrgUnitOrgId *model.Id `json:"org_unit_org_id"`
}
type RequestContext ¶
func (RequestContext) GetDbTranx ¶
func (this RequestContext) GetDbTranx() db.DbTransaction
func (RequestContext) GetDomainConstraints ¶
func (this RequestContext) GetDomainConstraints() dmodel.DynamicFields
func (RequestContext) GetLogger ¶
func (this RequestContext) GetLogger() logging.LoggerService
func (RequestContext) GetModuleName ¶
func (this RequestContext) GetModuleName() string
func (RequestContext) GetPermissions ¶
func (this RequestContext) GetPermissions() ContextPermissions
func (RequestContext) GetUser ¶
func (this RequestContext) GetUser() dmodel.DynamicFields
func (RequestContext) InnerContext ¶
func (this RequestContext) InnerContext() context.Context
func (*RequestContext) SetDbTranx ¶
func (this *RequestContext) SetDbTranx(trx db.DbTransaction)
func (*RequestContext) SetDomainConstraints ¶
func (this *RequestContext) SetDomainConstraints(constraints dmodel.DynamicFields)
func (*RequestContext) SetLogger ¶
func (this *RequestContext) SetLogger(logger logging.LoggerService)
func (*RequestContext) SetPermissions ¶
func (this *RequestContext) SetPermissions(permissions ContextPermissions)
func (*RequestContext) SetUser ¶
func (this *RequestContext) SetUser(user dmodel.DynamicFields)
func (*RequestContext) Value ¶
func (this *RequestContext) Value(key any) any
func (*RequestContext) WithValue ¶
func (this *RequestContext) WithValue(key, val any)
Replace current inner context with a new one that has the given key and value.
Click to show internal directories.
Click to hide internal directories.