codec

package
v0.0.0-...-c270618 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheProtoFileRegistry

type CacheProtoFileRegistry struct {
	// contains filtered or unexported fields
}

func (CacheProtoFileRegistry) Close

func (c CacheProtoFileRegistry) Close() error

func (CacheProtoFileRegistry) ProtoFileByPath

func (CacheProtoFileRegistry) ProtoFileContainingSymbol

func (c CacheProtoFileRegistry) ProtoFileContainingSymbol(name protoreflect.FullName) (*descriptorpb.FileDescriptorProto, error)

type Codec

type Codec struct {
	Registry *Registry
	// contains filtered or unexported fields
}

func NewCodec

func NewCodec(remote ProtoFileRegistry) *Codec

func (*Codec) GRPCCodec

func (c *Codec) GRPCCodec() encoding.Codec

func (*Codec) MarshalProto

func (c *Codec) MarshalProto(m proto.Message) ([]byte, error)

func (*Codec) MarshalProtoJSON

func (c *Codec) MarshalProtoJSON(m proto.Message) ([]byte, error)

func (*Codec) NewAny

func (c *Codec) NewAny(m proto.Message) (*anypb.Any, error)

func (*Codec) ProtoOptions

func (c *Codec) ProtoOptions() ProtoOptions

func (*Codec) UnmarshalProto

func (c *Codec) UnmarshalProto(b []byte, m proto.Message) error

func (*Codec) UnmarshalProtoJSON

func (c *Codec) UnmarshalProtoJSON(b []byte, m proto.Message) error

type GRPCReflectionProtoFileRegistry

type GRPCReflectionProtoFileRegistry struct {
	// contains filtered or unexported fields
}

GRPCReflectionProtoFileRegistry is a ProtoFileRegistry which uses grpc reflection to resolve files.

func NewGRPCReflectionProtoFileRegistry

func NewGRPCReflectionProtoFileRegistry(grpcEndpoint string) (*GRPCReflectionProtoFileRegistry, error)

func (*GRPCReflectionProtoFileRegistry) Close

func (*GRPCReflectionProtoFileRegistry) ProtoFileByPath

func (*GRPCReflectionProtoFileRegistry) ProtoFileContainingSymbol

type MultiProtoFileRegistry

type MultiProtoFileRegistry struct {
	// contains filtered or unexported fields
}

func NewMultiProtoFileRegistry

func NewMultiProtoFileRegistry(remotes ...ProtoFileRegistry) *MultiProtoFileRegistry

func (MultiProtoFileRegistry) Close

func (m MultiProtoFileRegistry) Close() error

func (MultiProtoFileRegistry) ProtoFileByPath

func (MultiProtoFileRegistry) ProtoFileContainingSymbol

func (m MultiProtoFileRegistry) ProtoFileContainingSymbol(name protoreflect.FullName) (*descriptorpb.FileDescriptorProto, error)

type ProtoFileRegistry

type ProtoFileRegistry interface {
	ProtoFileByPath(path string) (*descriptorpb.FileDescriptorProto, error)
	ProtoFileContainingSymbol(name protoreflect.FullName) (*descriptorpb.FileDescriptorProto, error)
	Close() error
}

type ProtoOptions

type ProtoOptions struct {
	Marshal       proto.MarshalOptions
	Unmarshal     proto.UnmarshalOptions
	JSONMarshal   protojson.MarshalOptions
	JSONUnmarshal protojson.UnmarshalOptions
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(remote ProtoFileRegistry) *Registry

func (Registry) FindDescriptorByName

func (r Registry) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error)

func (*Registry) FindExtensionByName

func (r *Registry) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error)

func (*Registry) FindExtensionByNumber

func (r *Registry) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error)

func (Registry) FindFileByPath

func (r Registry) FindFileByPath(s string) (protoreflect.FileDescriptor, error)

func (*Registry) FindMessageByName

func (r *Registry) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error)

func (*Registry) FindMessageByURL

func (r *Registry) FindMessageByURL(url string) (protoreflect.MessageType, error)

func (*Registry) Remote

func (r *Registry) Remote() ProtoFileRegistry

func (*Registry) Save

Jump to

Keyboard shortcuts

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