Documentation ¶
Index ¶
- func EncodeFieldInterface(enc zapcore.ObjectEncoder, field zap.Field) error
- func HTTPECSMapper(field zap.Field, object *HTTPMarshalObject)
- func IsNilValue(v interface{}) bool
- func IsUnmarshalableValue(v interface{}) bool
- type HTTPBodyMarshalObject
- type HTTPMarshalObject
- type HTTPObject
- type HTTPRequestMarshalObject
- type HTTPResponseMarshalObject
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeFieldInterface ¶
func EncodeFieldInterface(enc zapcore.ObjectEncoder, field zap.Field) error
EncodeFieldInterface is a proxy between the zap field and the encoder, determining the appropriate representation of each field value
func HTTPECSMapper ¶
func HTTPECSMapper(field zap.Field, object *HTTPMarshalObject)
func IsNilValue ¶
func IsNilValue(v interface{}) bool
IsNilValue performs a panic safe nil check on v, including embedded interface values
func IsUnmarshalableValue ¶
func IsUnmarshalableValue(v interface{}) bool
IsUnmarshalableValue performs a panic safe basic type and value assertion on v to check if it is apt for Unmarshal operations (that is, a non nil pointer value)
Types ¶
type HTTPBodyMarshalObject ¶
type HTTPMarshalObject ¶
type HTTPMarshalObject struct { Request *HTTPRequestMarshalObject `json:"request,omitempty"` Response *HTTPResponseMarshalObject `json:"response,omitempty"` }
type HTTPObject ¶
type HTTPObject struct {
// contains filtered or unexported fields
}
HTTPObject is a specialized nested struct which transforms into a serialized field
func NestedObject ¶
func NestedObject(baseKey string, mapper func(zap.Field, *HTTPMarshalObject), fields ...zap.Field) *HTTPObject
func (*HTTPObject) AsField ¶
func (f *HTTPObject) AsField() zap.Field
func (*HTTPObject) MarshalJSON ¶
func (f *HTTPObject) MarshalJSON() ([]byte, error)
func (*HTTPObject) MarshalLogObject ¶
func (f *HTTPObject) MarshalLogObject(enc zapcore.ObjectEncoder) error
type HTTPRequestMarshalObject ¶
type HTTPRequestMarshalObject struct { Body *HTTPBodyMarshalObject `json:"body,omitempty"` RequestMethod string `json:"method,omitempty"` RequestReferrer string `json:"referrer,omitempty"` }
type HTTPResponseMarshalObject ¶
type HTTPResponseMarshalObject struct { Body *HTTPBodyMarshalObject `json:"body,omitempty"` ResponseReferrer string `json:"referrer,omitempty"` }
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object is a field wrapper which encodes them into a plain, key/value struct upon marshal
func (*Object) MarshalLogObject ¶
func (f *Object) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject marshals the object as required by the zap serializer
Click to show internal directories.
Click to hide internal directories.