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 ¶
- func AddAny(enc zapcore.ObjectEncoder, key string, a *anypb.Any)
- func AddBytes(enc zapcore.ObjectEncoder, key string, b []byte)
- func AddBytesValue(enc zapcore.ObjectEncoder, key string, b *wrapperspb.BytesValue)
- func AddDuration(enc zapcore.ObjectEncoder, key string, dpb *durationpb.Duration)
- func AddHalfString(enc zapcore.ObjectEncoder, key, value string)
- func AddInt64Value(enc zapcore.ObjectEncoder, key string, i *wrapperspb.Int64Value)
- func AddTimestamp(enc zapcore.ObjectEncoder, key string, ts *timestamppb.Timestamp)
- type ConciseBytes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAny ¶
func AddAny(enc zapcore.ObjectEncoder, key string, a *anypb.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 *wrapperspb.BytesValue)
AddBytesValue encodes an abridged google.protobuf.BytesValue.
func AddDuration ¶
func AddDuration(enc zapcore.ObjectEncoder, key string, dpb *durationpb.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 *wrapperspb.Int64Value)
AddInt64Value encodes a google.protobuf.Int64Value.
func AddTimestamp ¶
func AddTimestamp(enc zapcore.ObjectEncoder, key string, ts *timestamppb.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.