Documentation ¶
Index ¶
- type Fields
- type PendingField
- type PendingFields
- func (pendingFields *PendingFields) AddMultiple(fields Fields)
- func (pendingFields *PendingFields) AddOne(key string, value interface{})
- func (pendingFields PendingFields) Clone() PendingFields
- func (pendingFields PendingFields) Compile() Fields
- func (pendingFields PendingFields) CompileWithStorage(m Fields) Fields
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields is a multiple of fields which are attached to logger/tracer messages.
type PendingField ¶
type PendingField struct {
// contains filtered or unexported fields
}
PendingField is a one entry of a history of added fields.
PendingField is focused on high-performance Clone method, for details see PendingFields.
type PendingFields ¶
PendingFields is a history of added fields. It is focused on cheap cloning and adding new entries avoiding extra copy all the data on each adding of key-values. Therefore it is so-so performance-safe to use it for scoped contexts.
A resulting value could be received (compiled) on-need-basis using method Compile.
See also benchmark comments in pending_fields_test.go.
func (*PendingFields) AddMultiple ¶
func (pendingFields *PendingFields) AddMultiple(fields Fields)
AddMultiple adds a set of fields.
func (*PendingFields) AddOne ¶
func (pendingFields *PendingFields) AddOne(key string, value interface{})
AddOne adds one field.
func (PendingFields) Clone ¶
func (pendingFields PendingFields) Clone() PendingFields
Clone returns a "copy" of PendingFields. It is safe to add new entries to this "copy" (it will not affect the original).
func (PendingFields) Compile ¶
func (pendingFields PendingFields) Compile() Fields
Compile constructs Fields from PendingFields.
func (PendingFields) CompileWithStorage ¶
func (pendingFields PendingFields) CompileWithStorage(m Fields) Fields
CompileWithStorage is the same as Compile, but allows to pass a storage to save values to. It could be used, for example, to reuse existing storages to reduce pressure on GC.
type Slice ¶
type Slice []PendingField
Slice is a set of entries of a history of added fields.
See PendingFields.