Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendServiceContext ¶
func AppendServiceContext(ctx context.Context, svcCtx *ServiceContext) context.Context
AppendServiceContext adds all ServiceContext key-values inside the current context.
Types ¶
type ServiceContext ¶
type ServiceContext struct {
// contains filtered or unexported fields
}
ServiceContext is an object that is stored inside a service RPC/HTTP handler context.Context in order to provide information at all source levels, such as, the logger.
func FromContext ¶
func FromContext(ctx context.Context) (*ServiceContext, bool)
FromContext retrieves a ServiceContext from the current context.
func New ¶
func New(options *Options) (*ServiceContext, error)
func (*ServiceContext) Add ¶
func (s *ServiceContext) Add(key, value string)
Add adds a new key-value value pair inside the ServiceContext object.
func (*ServiceContext) Get ¶
func (s *ServiceContext) Get(key string) (string, bool)
Get retrieves a value stored inside the current ServiceContext.
func (*ServiceContext) Values ¶
func (s *ServiceContext) Values() map[string]string
Values gives a copy of the internal key-value ServiceContext container.
Click to show internal directories.
Click to hide internal directories.