protos

package
v0.0.167 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const FoundationTypeUrlBaseSlash = "type.foundation.namespacelabs.dev/"

Variables

View Source
var File_internal_codegen_protos_filedescset_proto protoreflect.FileDescriptor
View Source
var WriteFile = protos.WriteFile

Functions

func CleanupForNonProvisioning

func CleanupForNonProvisioning(msg protoreflect.Message)

func CleanupSensitive

func CleanupSensitive(msg protoreflect.Message)

func LookupDescriptorProto

func LookupDescriptorProto(src *FileDescriptorSetAndDeps, typename string) (*dpb.FileDescriptorProto, *dpb.DescriptorProto)

func LookupEnumDescriptorProto

func LookupEnumDescriptorProto(src *FileDescriptorSetAndDeps, typename string) *dpb.EnumDescriptorProto

func ReadFile

func ReadFile[V proto.Message](path string) (V, error)

func ReadFileAndBytes

func ReadFileAndBytes[V proto.Message](path string) (V, []byte, error)

Types

type FileDescriptorSetAndDeps

type FileDescriptorSetAndDeps struct {
	File       []*descriptorpb.FileDescriptorProto `protobuf:"bytes,1,rep,name=file,proto3" json:"file,omitempty"`
	Dependency []*descriptorpb.FileDescriptorProto `protobuf:"bytes,2,rep,name=dependency,proto3" json:"dependency,omitempty"`
	// contains filtered or unexported fields
}

func Merge

Merge produces a filename-only merge of all provided files. It is the caller's responsibility to make sure the contents of the protos are consistent and mergeable.

func (*FileDescriptorSetAndDeps) AsFileDescriptorSet

func (fds *FileDescriptorSetAndDeps) AsFileDescriptorSet() *dpb.FileDescriptorSet

func (*FileDescriptorSetAndDeps) Descriptor deprecated

func (*FileDescriptorSetAndDeps) Descriptor() ([]byte, []int)

Deprecated: Use FileDescriptorSetAndDeps.ProtoReflect.Descriptor instead.

func (*FileDescriptorSetAndDeps) GetDependency

func (*FileDescriptorSetAndDeps) GetFile

func (*FileDescriptorSetAndDeps) ProtoMessage

func (*FileDescriptorSetAndDeps) ProtoMessage()

func (*FileDescriptorSetAndDeps) ProtoReflect

func (x *FileDescriptorSetAndDeps) ProtoReflect() protoreflect.Message

func (*FileDescriptorSetAndDeps) Reset

func (x *FileDescriptorSetAndDeps) Reset()

func (*FileDescriptorSetAndDeps) String

func (x *FileDescriptorSetAndDeps) String() string

type Location

type Location interface {
	Rel(...string) string
}

type ParseOpts

type ParseOpts struct {
	KnownModules []struct {
		ModuleName string
		FS         fs.FS
	}
}

func (ParseOpts) LoadMessageAtLocation

func (opts ParseOpts) LoadMessageAtLocation(fsys fs.FS, loc Location, sources []string, name string) (protoreflect.MessageDescriptor, error)

func (ParseOpts) Parse

func (opts ParseOpts) Parse(fsys fs.FS, files []string) (*FileDescriptorSetAndDeps, error)

func (ParseOpts) ParseAtLocation

func (opts ParseOpts) ParseAtLocation(fsys fs.FS, loc Location, files []string) (*FileDescriptorSetAndDeps, error)

type TypeReference

type TypeReference struct {
	Package   schema.PackageName
	ProtoType string
	Builtin   bool
}

func Ref

func Ref(dep *anypb.Any) *TypeReference

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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