protoextensions

package
v2.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 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

View Source
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",
}
View Source
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.

Jump to

Keyboard shortcuts

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