Documentation ¶
Index ¶
- func DefaultCallContextBuilder(methodName string, parentLogger logger.Logger, fields ...logger.Fields) op_context.CallContext
- func NewAppInitContext(app app_context.Context) op_context.Context
- type CallContextBase
- func (c *CallContextBase) AddLoggerFields(fields logger.Fields)
- func (c *CallContextBase) Err() *error
- func (c *CallContextBase) Error() error
- func (c *CallContextBase) Logger() logger.Logger
- func (c *CallContextBase) LoggerFields() logger.Fields
- func (c *CallContextBase) Message() string
- func (c *CallContextBase) Method() string
- func (c *CallContextBase) SetError(err error) error
- func (c *CallContextBase) SetErrorStr(err string) error
- func (c *CallContextBase) SetLogger(logger.Logger)
- func (c *CallContextBase) SetLoggerField(name string, value interface{})
- func (c *CallContextBase) SetMessage(msg string)
- func (c *CallContextBase) UnsetLoggerField(name string)
- type ContextBase
- func (c *ContextBase) AddLoggerFields(fields logger.Fields)
- func (c *ContextBase) BaseContext() *ContextBase
- func (c *ContextBase) Cache() cache.Cache
- func (c *ContextBase) ClearDbTransaction()
- func (c *ContextBase) ClearError()
- func (c *ContextBase) Close(successMessage ...string)
- func (c *ContextBase) DbTransaction() db.Transaction
- func (c *ContextBase) DumpLog(successMessage ...string)
- func (c *ContextBase) ErrorManager() generic_error.ErrorManager
- func (c *ContextBase) GenericError() generic_error.Error
- func (c *ContextBase) ID() string
- func (c *ContextBase) Init(app app_context.Context, log logger.Logger, db db.DB, fields ...logger.Fields)
- func (c *ContextBase) Logger() logger.Logger
- func (c *ContextBase) LoggerFields() logger.Fields
- func (c *ContextBase) MainDB() db.DB
- func (c *ContextBase) MainLogger() logger.Logger
- func (c *ContextBase) MakeGenericError(code string) generic_error.Error
- func (c *ContextBase) Name() string
- func (c *ContextBase) Oplog(o oplog.Oplog)
- func (c *ContextBase) OplogHandler() op_context.OplogHandler
- func (c *ContextBase) OplogWriter() oplog.OplogController
- func (c *ContextBase) Origin() op_context.Origin
- func (c *ContextBase) OverrideDb() db.DBHandlers
- func (c *ContextBase) Reset()
- func (c *ContextBase) SetCache(cache cache.Cache)
- func (c *ContextBase) SetCallContextBuilder(builder op_context.CallContextBuilder)
- func (c *ContextBase) SetDbTransaction(tx db.Transaction)
- func (c *ContextBase) SetErrorAsWarn(enable bool)
- func (c *ContextBase) SetErrorManager(manager generic_error.ErrorManager)
- func (c *ContextBase) SetGenericError(err generic_error.Error, override ...bool)
- func (c *ContextBase) SetGenericErrorCode(code string, override ...bool)
- func (c *ContextBase) SetID(id string)
- func (c *ContextBase) SetLoggerField(name string, value interface{})
- func (c *ContextBase) SetName(name string)
- func (c *ContextBase) SetOplogHandler(handler op_context.OplogHandler)
- func (c *ContextBase) SetOplogWriter(writer oplog.OplogController)
- func (c *ContextBase) SetOrigin(o op_context.Origin)
- func (c *ContextBase) SetOverrideDb(db db.DBHandlers)
- func (c *ContextBase) SetWriteCloseLog(enable bool)
- func (c *ContextBase) Tr(phrase string) string
- func (c *ContextBase) TraceInMethod(methodName string, fields ...logger.Fields) op_context.CallContext
- func (c *ContextBase) TraceOutMethod()
- func (c *ContextBase) UnsetLoggerField(name string)
- type Origin
- func (o *Origin) App() string
- func (o *Origin) CopyOrigin(other op_context.Origin)
- func (o *Origin) Name() string
- func (o *Origin) SessionClient() string
- func (o *Origin) SetApp(val string)
- func (o *Origin) SetName(val string)
- func (o *Origin) SetSessionClient(val string)
- func (o *Origin) SetSource(val string)
- func (o *Origin) SetUser(val string)
- func (o *Origin) SetUserType(val string)
- func (o *Origin) Source() string
- func (o *Origin) User() string
- func (o *Origin) UserType() string
- type OriginHolder
- type WithBaseContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCallContextBuilder ¶
func DefaultCallContextBuilder(methodName string, parentLogger logger.Logger, fields ...logger.Fields) op_context.CallContext
func NewAppInitContext ¶
func NewAppInitContext(app app_context.Context) op_context.Context
Types ¶
type CallContextBase ¶
type CallContextBase struct {
// contains filtered or unexported fields
}
func (*CallContextBase) AddLoggerFields ¶
func (c *CallContextBase) AddLoggerFields(fields logger.Fields)
func (*CallContextBase) Err ¶
func (c *CallContextBase) Err() *error
func (*CallContextBase) Error ¶
func (c *CallContextBase) Error() error
func (*CallContextBase) Logger ¶
func (c *CallContextBase) Logger() logger.Logger
func (*CallContextBase) LoggerFields ¶
func (c *CallContextBase) LoggerFields() logger.Fields
func (*CallContextBase) Message ¶
func (c *CallContextBase) Message() string
func (*CallContextBase) Method ¶
func (c *CallContextBase) Method() string
func (*CallContextBase) SetError ¶
func (c *CallContextBase) SetError(err error) error
func (*CallContextBase) SetErrorStr ¶
func (c *CallContextBase) SetErrorStr(err string) error
func (*CallContextBase) SetLogger ¶
func (c *CallContextBase) SetLogger(logger.Logger)
func (*CallContextBase) SetLoggerField ¶
func (c *CallContextBase) SetLoggerField(name string, value interface{})
func (*CallContextBase) SetMessage ¶
func (c *CallContextBase) SetMessage(msg string)
func (*CallContextBase) UnsetLoggerField ¶
func (c *CallContextBase) UnsetLoggerField(name string)
type ContextBase ¶
type ContextBase struct { app_context.WithAppBase logger.WithLoggerBase db.WithDBBase // contains filtered or unexported fields }
func BackgroundOpContext ¶
func BackgroundOpContext(app app_context.Context, name string) *ContextBase
func NewContext ¶
func NewContext() *ContextBase
func NewInitContext ¶
func NewInitContext(app app_context.Context, log logger.Logger, db db.DB) *ContextBase
func (*ContextBase) AddLoggerFields ¶
func (c *ContextBase) AddLoggerFields(fields logger.Fields)
func (*ContextBase) BaseContext ¶
func (c *ContextBase) BaseContext() *ContextBase
func (*ContextBase) Cache ¶
func (c *ContextBase) Cache() cache.Cache
func (*ContextBase) ClearDbTransaction ¶
func (c *ContextBase) ClearDbTransaction()
func (*ContextBase) ClearError ¶
func (c *ContextBase) ClearError()
func (*ContextBase) Close ¶
func (c *ContextBase) Close(successMessage ...string)
func (*ContextBase) DbTransaction ¶
func (c *ContextBase) DbTransaction() db.Transaction
func (*ContextBase) DumpLog ¶
func (c *ContextBase) DumpLog(successMessage ...string)
func (*ContextBase) ErrorManager ¶
func (c *ContextBase) ErrorManager() generic_error.ErrorManager
func (*ContextBase) GenericError ¶
func (c *ContextBase) GenericError() generic_error.Error
func (*ContextBase) ID ¶
func (c *ContextBase) ID() string
func (*ContextBase) Init ¶
func (c *ContextBase) Init(app app_context.Context, log logger.Logger, db db.DB, fields ...logger.Fields)
func (*ContextBase) Logger ¶
func (c *ContextBase) Logger() logger.Logger
func (*ContextBase) LoggerFields ¶
func (c *ContextBase) LoggerFields() logger.Fields
func (*ContextBase) MainDB ¶
func (c *ContextBase) MainDB() db.DB
func (*ContextBase) MainLogger ¶
func (c *ContextBase) MainLogger() logger.Logger
func (*ContextBase) MakeGenericError ¶
func (c *ContextBase) MakeGenericError(code string) generic_error.Error
func (*ContextBase) Name ¶
func (c *ContextBase) Name() string
func (*ContextBase) Oplog ¶
func (c *ContextBase) Oplog(o oplog.Oplog)
func (*ContextBase) OplogHandler ¶
func (c *ContextBase) OplogHandler() op_context.OplogHandler
func (*ContextBase) OplogWriter ¶
func (c *ContextBase) OplogWriter() oplog.OplogController
func (*ContextBase) Origin ¶
func (c *ContextBase) Origin() op_context.Origin
func (*ContextBase) OverrideDb ¶
func (c *ContextBase) OverrideDb() db.DBHandlers
func (*ContextBase) Reset ¶
func (c *ContextBase) Reset()
func (*ContextBase) SetCache ¶
func (c *ContextBase) SetCache(cache cache.Cache)
func (*ContextBase) SetCallContextBuilder ¶
func (c *ContextBase) SetCallContextBuilder(builder op_context.CallContextBuilder)
func (*ContextBase) SetDbTransaction ¶
func (c *ContextBase) SetDbTransaction(tx db.Transaction)
func (*ContextBase) SetErrorAsWarn ¶
func (c *ContextBase) SetErrorAsWarn(enable bool)
func (*ContextBase) SetErrorManager ¶
func (c *ContextBase) SetErrorManager(manager generic_error.ErrorManager)
func (*ContextBase) SetGenericError ¶
func (c *ContextBase) SetGenericError(err generic_error.Error, override ...bool)
func (*ContextBase) SetGenericErrorCode ¶
func (c *ContextBase) SetGenericErrorCode(code string, override ...bool)
func (*ContextBase) SetID ¶
func (c *ContextBase) SetID(id string)
func (*ContextBase) SetLoggerField ¶
func (c *ContextBase) SetLoggerField(name string, value interface{})
func (*ContextBase) SetName ¶
func (c *ContextBase) SetName(name string)
func (*ContextBase) SetOplogHandler ¶
func (c *ContextBase) SetOplogHandler(handler op_context.OplogHandler)
func (*ContextBase) SetOplogWriter ¶
func (c *ContextBase) SetOplogWriter(writer oplog.OplogController)
func (*ContextBase) SetOrigin ¶
func (c *ContextBase) SetOrigin(o op_context.Origin)
func (*ContextBase) SetOverrideDb ¶
func (c *ContextBase) SetOverrideDb(db db.DBHandlers)
func (*ContextBase) SetWriteCloseLog ¶
func (c *ContextBase) SetWriteCloseLog(enable bool)
func (*ContextBase) Tr ¶
func (c *ContextBase) Tr(phrase string) string
func (*ContextBase) TraceInMethod ¶
func (c *ContextBase) TraceInMethod(methodName string, fields ...logger.Fields) op_context.CallContext
func (*ContextBase) TraceOutMethod ¶
func (c *ContextBase) TraceOutMethod()
func (*ContextBase) UnsetLoggerField ¶
func (c *ContextBase) UnsetLoggerField(name string)
type Origin ¶
type Origin struct {
OriginHolder
}
func NewOrigin ¶
func NewOrigin(app app_context.Context) *Origin
func (*Origin) CopyOrigin ¶
func (o *Origin) CopyOrigin(other op_context.Origin)
func (*Origin) SessionClient ¶
func (*Origin) SetSessionClient ¶
func (*Origin) SetUserType ¶
type OriginHolder ¶
type OriginHolder struct { App string `json:"origin_app" gorm:"index;column:origin_app"` Name string `json:"origin_name" gorm:"index;column:origin_name"` Source string `json:"origin_source" gorm:"index;column:origin_source"` SessionClient string `json:"origin_session_client" gorm:"index;column:origin_session_client"` User string `json:"origin_user" gorm:"index;column:origin_user"` UserType string `json:"origin_user_type" gorm:"index;column:origin_user_type"` }
type WithBaseContext ¶
type WithBaseContext interface {
BaseContext() *ContextBase
}
Click to show internal directories.
Click to hide internal directories.