protobuffers

package
v0.0.0-...-3cc3ff2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Optional label representing a optional field
	Optional = descriptor.FieldDescriptorProto_LABEL_OPTIONAL
	// Required label representing a required field
	Required = descriptor.FieldDescriptorProto_LABEL_REQUIRED
	// Repeated label representing a repeated field
	Repeated = descriptor.FieldDescriptorProto_LABEL_REPEATED
)
View Source
const (
	// NameOption represents the Service name option key
	NameOption = "service_name"
	// HostOption represents the Service host option key
	HostOption = "service_host"
	// TransportOption represents the Service transport option key
	TransportOption = "service_transport"
	// CodecOption represents the Service codec option key
	CodecOption = "service_codec"
	// RequestCodecOption represents the Service request codec option key
	RequestCodecOption = "service_request_codec"
	// ResponseCodecOption represents the Service response codec option key
	ResponseCodecOption = "service_response_codec"
)

Variables

Labels is a lookup table for field label types

ProtoLabels is a lookup table for field label types

ProtoTypes is a lookup table for field descriptor types

Types is a lookup table for field descriptor types

Functions

func Collect

func Collect(ctx *broker.Context, paths []string, path string) ([]*desc.FileDescriptor, error)

Collect attempts to collect all the available proto files inside the given path and parses them to resources

func NewMessage

func NewMessage(path string, descriptor *desc.MessageDescriptor) *specs.Property

NewMessage constructs a schema Property with the given message descriptor

func NewMethod

func NewMethod(descriptor *desc.MethodDescriptor) *specs.Method

NewMethod constructs a new method with the given descriptor

func NewProperty

func NewProperty(path string, descriptor *desc.FieldDescriptor) *specs.Property

NewProperty constructs a schema Property with the given field descriptor

func NewSchema

func NewSchema(descriptors []*desc.FileDescriptor) specs.Schemas

NewSchema constructs a new schema manifest from the given file descriptors

func NewService

func NewService(descriptor *desc.ServiceDescriptor) *specs.Service

NewService constructs a new service with the given descriptor

func NewServices

func NewServices(descriptors []*desc.FileDescriptor) specs.ServiceList

NewServices constructs a new service(s) manifest from the given file descriptors

func SchemaResolver

func SchemaResolver(imports []string, path string) providers.SchemaResolver

SchemaResolver returns a new schema resolver for the given protoc collection

func ServiceResolver

func ServiceResolver(imports []string, path string) providers.ServicesResolver

ServiceResolver returns a new service(s) resolver for the given protoc collection

func UnmarshalFiles

func UnmarshalFiles(imports []string, files []*providers.FileInfo) ([]*desc.FileDescriptor, error)

UnmarshalFiles attempts to parse the given HCL files to intermediate resources. Files are parsed based from the given import paths

Types

This section is empty.

Jump to

Keyboard shortcuts

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