protoextensions

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

json-schema-options.proto is from: ~/go/pkg/mod/github.com/chrusty/protoc-gen-jsonschema@v0.0.0-20230418203306-956cc32e45d6/options.proto

validate.proto is from: ~/go/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v1.0.2/validate/validate.proto

We vendor these here for the ease of multi-language proto compilation.

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 (
	// optional bool mask = 50001;
	E_Mask = &file_protoextensions_log_proto_extTypes[0]
	// optional bool half = 50002;
	E_Half = &file_protoextensions_log_proto_extTypes[1]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var File_protoextensions_log_proto protoreflect.FileDescriptor

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