Documentation ¶
Overview ¶
Package protoextensions is the runtime support code for protoc-gen-zap (in ../etc/proto). log.Proto also uses this code, so that embedded messages are marshaled the same way as raw messages.
Index ¶
- Variables
- func AddAny(enc zapcore.ObjectEncoder, key string, a *types.Any)
- func AddBytes(enc zapcore.ObjectEncoder, key string, b []byte)
- func AddBytesValue(enc zapcore.ObjectEncoder, key string, b *types.BytesValue)
- func AddDuration(enc zapcore.ObjectEncoder, key string, dpb *types.Duration)
- func AddHalfString(enc zapcore.ObjectEncoder, key, value string)
- func AddInt64Value(enc zapcore.ObjectEncoder, key string, i *types.Int64Value)
- func AddTimestamp(enc zapcore.ObjectEncoder, key string, ts *types.Timestamp)
- type ConciseBytes
Constants ¶
This section is empty.
Variables ¶
var E_Half = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 50002, Name: "log.half", Tag: "varint,50002,opt,name=half", Filename: "protoextensions/log.proto", }
var E_Mask = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 50001, Name: "log.mask", Tag: "varint,50001,opt,name=mask", Filename: "protoextensions/log.proto", }
Functions ¶
func AddAny ¶
func AddAny(enc zapcore.ObjectEncoder, key string, a *types.Any)
AddAny encodes a google.protobuf.Any.
func AddBytes ¶
func AddBytes(enc zapcore.ObjectEncoder, key string, b []byte)
AddBytes encodes an abridged []byte.
func AddBytesValue ¶
func AddBytesValue(enc zapcore.ObjectEncoder, key string, b *types.BytesValue)
AddBytesValue encodes an abridged google.protobuf.BytesValue.
func AddDuration ¶
func AddDuration(enc zapcore.ObjectEncoder, key string, dpb *types.Duration)
AddDuration encodes a google.protobuf.Duration.
func AddHalfString ¶
func AddHalfString(enc zapcore.ObjectEncoder, key, value string)
AddHalfString adds the first half of a string, and a message saying how many bytes were omitted.
func AddInt64Value ¶
func AddInt64Value(enc zapcore.ObjectEncoder, key string, i *types.Int64Value)
AddInt64Value encodes a google.protobuf.Int64Value.
func AddTimestamp ¶
func AddTimestamp(enc zapcore.ObjectEncoder, key string, ts *types.Timestamp)
AddTimestamp encodes a google.protobuf.Timestamp.
Types ¶
type ConciseBytes ¶
type ConciseBytes []byte
ConciseBytes is []byte that implements zap.ObjectMarshaler in a way that only prints the first 32 of the provided bytes.
func (ConciseBytes) MarshalLogObject ¶
func (b ConciseBytes) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zap.ObjectMarshaler.