default_op_context

package
v0.0.0-...-8122643 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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) App

func (o *Origin) App() string

func (*Origin) CopyOrigin

func (o *Origin) CopyOrigin(other op_context.Origin)

func (*Origin) Name

func (o *Origin) Name() string

func (*Origin) SessionClient

func (o *Origin) SessionClient() string

func (*Origin) SetApp

func (o *Origin) SetApp(val string)

func (*Origin) SetName

func (o *Origin) SetName(val string)

func (*Origin) SetSessionClient

func (o *Origin) SetSessionClient(val string)

func (*Origin) SetSource

func (o *Origin) SetSource(val string)

func (*Origin) SetUser

func (o *Origin) SetUser(val string)

func (*Origin) SetUserType

func (o *Origin) SetUserType(val string)

func (*Origin) Source

func (o *Origin) Source() string

func (*Origin) User

func (o *Origin) User() string

func (*Origin) UserType

func (o *Origin) UserType() string

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
}

Jump to

Keyboard shortcuts

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