descriptorv1

package
v1.36.10-2025071818194... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_buf_plugin_descriptor_v1_file_descriptor_proto protoreflect.FileDescriptor
View Source
var File_buf_plugin_descriptor_v1_file_location_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FileDescriptor

type FileDescriptor struct {

	// The FileDescriptorProto that represents the file.
	//
	// Required.
	FileDescriptorProto *descriptorpb.FileDescriptorProto `protobuf:"bytes,1,opt,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"`
	// Whether or not the file is considered an "import".
	//
	// An import is a file that is either:
	//
	//   - A Well-Known Type included from the compiler and imported by a targeted file.
	//   - A file that was included from a Buf module dependency and imported by a targeted file.
	//   - A file that was not targeted, but was imported by a targeted file.
	//
	// We use "import" as this matches with the protoc concept of --include_imports, however
	// import is a bit of an overloaded term.
	IsImport bool `protobuf:"varint,2,opt,name=is_import,json=isImport,proto3" json:"is_import,omitempty"`
	// Whether the file did not have a syntax explicitly specified.
	//
	// Per the FileDescriptorProto spec, it would be fine in this case to just leave the syntax field
	// unset to denote this and to set the syntax field to "proto2" if it is specified. However,
	// protoc does not set the syntax field if it was "proto2". Plugins may want to differentiate
	// between "proto2" and unset, and this field allows them to.
	IsSyntaxUnspecified bool `protobuf:"varint,3,opt,name=is_syntax_unspecified,json=isSyntaxUnspecified,proto3" json:"is_syntax_unspecified,omitempty"`
	// The indexes within the dependency field on FileDescriptorProto for those dependencies that
	// are not used.
	//
	// This matches the shape of the public_dependency and weak_dependency fields.
	UnusedDependency []int32 `protobuf:"varint,4,rep,packed,name=unused_dependency,json=unusedDependency,proto3" json:"unused_dependency,omitempty"`
	// contains filtered or unexported fields
}

A file descriptor.

A FileDescriptor is represented as a FileDescriptorProto, with the additional property of whether or not the File is an import.

func (*FileDescriptor) ClearFileDescriptorProto

func (x *FileDescriptor) ClearFileDescriptorProto()

func (*FileDescriptor) GetFileDescriptorProto

func (x *FileDescriptor) GetFileDescriptorProto() *descriptorpb.FileDescriptorProto

func (*FileDescriptor) GetIsImport

func (x *FileDescriptor) GetIsImport() bool

func (*FileDescriptor) GetIsSyntaxUnspecified

func (x *FileDescriptor) GetIsSyntaxUnspecified() bool

func (*FileDescriptor) GetUnusedDependency

func (x *FileDescriptor) GetUnusedDependency() []int32

func (*FileDescriptor) HasFileDescriptorProto

func (x *FileDescriptor) HasFileDescriptorProto() bool

func (*FileDescriptor) ProtoMessage

func (*FileDescriptor) ProtoMessage()

func (*FileDescriptor) ProtoReflect

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

func (*FileDescriptor) Reset

func (x *FileDescriptor) Reset()

func (*FileDescriptor) SetFileDescriptorProto

func (x *FileDescriptor) SetFileDescriptorProto(v *descriptorpb.FileDescriptorProto)

func (*FileDescriptor) SetIsImport

func (x *FileDescriptor) SetIsImport(v bool)

func (*FileDescriptor) SetIsSyntaxUnspecified

func (x *FileDescriptor) SetIsSyntaxUnspecified(v bool)

func (*FileDescriptor) SetUnusedDependency

func (x *FileDescriptor) SetUnusedDependency(v []int32)

func (*FileDescriptor) String

func (x *FileDescriptor) String() string

type FileDescriptor_builder

type FileDescriptor_builder struct {

	// The FileDescriptorProto that represents the file.
	//
	// Required.
	FileDescriptorProto *descriptorpb.FileDescriptorProto
	// Whether or not the file is considered an "import".
	//
	// An import is a file that is either:
	//
	//   - A Well-Known Type included from the compiler and imported by a targeted file.
	//   - A file that was included from a Buf module dependency and imported by a targeted file.
	//   - A file that was not targeted, but was imported by a targeted file.
	//
	// We use "import" as this matches with the protoc concept of --include_imports, however
	// import is a bit of an overloaded term.
	IsImport bool
	// Whether the file did not have a syntax explicitly specified.
	//
	// Per the FileDescriptorProto spec, it would be fine in this case to just leave the syntax field
	// unset to denote this and to set the syntax field to "proto2" if it is specified. However,
	// protoc does not set the syntax field if it was "proto2". Plugins may want to differentiate
	// between "proto2" and unset, and this field allows them to.
	IsSyntaxUnspecified bool
	// The indexes within the dependency field on FileDescriptorProto for those dependencies that
	// are not used.
	//
	// This matches the shape of the public_dependency and weak_dependency fields.
	UnusedDependency []int32
	// contains filtered or unexported fields
}

func (FileDescriptor_builder) Build

type FileLocation

type FileLocation struct {

	// The name of the FileDescriptor. This matches the name field in the corresponding FileDescriptorProto.
	//
	// Required.
	//
	// The path must be relative, and cannot contain any "." or ".." components.
	// The separator "/" must be used.
	FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
	// The SourceCodeInfo.Location.path within the FileDescriptorProto.
	//
	// This corresponds to a SourceCodeInfo.Location within the corresponding FileDescriptorProto.
	// Buf will find the first SourceCodeInfo.Location with this path, and use this to extract line
	// and column information, as well as read the comments for ignores.
	//
	// Optional. If not set, the Location just references the File as a whole.
	//
	// It is not valid to have a non-zero value of source_path without a name.
	SourcePath []int32 `protobuf:"varint,2,rep,packed,name=source_path,json=sourcePath,proto3" json:"source_path,omitempty"`
	// contains filtered or unexported fields
}

A reference to a FileDescriptor or to a location within a FileDescriptor.

A FileDescriptor is referenced by name. A location is referenced by its source path, following the semantics of google.protobuf.SourceCodeInfo.Location.path.

A FileLocation may or may not include a source path. If a source path is not included, the FileLocation just references the FileDescriptor as a whole.

func (*FileLocation) GetFileName

func (x *FileLocation) GetFileName() string

func (*FileLocation) GetSourcePath

func (x *FileLocation) GetSourcePath() []int32

func (*FileLocation) ProtoMessage

func (*FileLocation) ProtoMessage()

func (*FileLocation) ProtoReflect

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

func (*FileLocation) Reset

func (x *FileLocation) Reset()

func (*FileLocation) SetFileName

func (x *FileLocation) SetFileName(v string)

func (*FileLocation) SetSourcePath

func (x *FileLocation) SetSourcePath(v []int32)

func (*FileLocation) String

func (x *FileLocation) String() string

type FileLocation_builder

type FileLocation_builder struct {

	// The name of the FileDescriptor. This matches the name field in the corresponding FileDescriptorProto.
	//
	// Required.
	//
	// The path must be relative, and cannot contain any "." or ".." components.
	// The separator "/" must be used.
	FileName string
	// The SourceCodeInfo.Location.path within the FileDescriptorProto.
	//
	// This corresponds to a SourceCodeInfo.Location within the corresponding FileDescriptorProto.
	// Buf will find the first SourceCodeInfo.Location with this path, and use this to extract line
	// and column information, as well as read the comments for ignores.
	//
	// Optional. If not set, the Location just references the File as a whole.
	//
	// It is not valid to have a non-zero value of source_path without a name.
	SourcePath []int32
	// contains filtered or unexported fields
}

func (FileLocation_builder) Build

func (b0 FileLocation_builder) Build() *FileLocation

Source Files

  • file_descriptor.pb.go
  • file_location.pb.go

Jump to

Keyboard shortcuts

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