protoextensions

package
v0.0.0-...-4cd6af7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL