Documentation ¶
Index ¶
- Variables
- func CreateContextWithMap(ctx context.Context, valuesKey ContextValuesKey, cm ContextMap) context.Context
- func CreateContextWithValues(ctx context.Context, valuesKey ContextValuesKey, values Values) context.Context
- func GetContextValuesKey(ctx context.Context, contextValuesKey ContextValuesKey, key ContextKey) (interface{}, error)
- func GetFieldsMap(ctx context.Context, contextValuesKey ContextValuesKey, fields ...interface{}) (map[string]interface{}, error)
- func WrapError(message string, err error) error
- type ContextKey
- type ContextMap
- type ContextValuesKey
- type Values
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateContextWithMap ¶
func CreateContextWithMap(ctx context.Context, valuesKey ContextValuesKey, cm ContextMap) context.Context
func CreateContextWithValues ¶
func GetContextValuesKey ¶
func GetContextValuesKey(ctx context.Context, contextValuesKey ContextValuesKey, key ContextKey) (interface{}, error)
GetContextValuesKey get value for key from contextValuesKey map stored in context.
func GetFieldsMap ¶
func GetFieldsMap(ctx context.Context, contextValuesKey ContextValuesKey, fields ...interface{}) (map[string]interface{}, error)
GetFieldsMap - get field list from Context and append fields list to it.
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey comprises keys used to access common information from a request context.
type ContextMap ¶
type ContextMap map[ContextKey]interface{}
ContextMap - Context Map type wrapped by Values.
func PairFields ¶
func PairFields(fields ...interface{}) ContextMap
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
Values - struct to store values on context.
func GetContextValues ¶
func GetContextValues(ctx context.Context, contextValuesKey ContextValuesKey) (*Values, error)
GetContextValues contextValuesKey map stored in context.
func NewValues ¶
func NewValues(m ContextMap) Values
func (Values) GetKey ¶
func (v Values) GetKey(key ContextKey) interface{}
GetKey - GetKey value from Values struct.
func (Values) GetMap ¶
func (v Values) GetMap() ContextMap
GetMap - GetMap value from Values struct.
Click to show internal directories.
Click to hide internal directories.