Documentation ¶
Overview ¶
Package analysis_proto is a generated protocol buffer package.
It is generated from these files:
kythe/proto/analysis.proto
It has these top-level messages:
AnalysisRequest AnalysisOutput CompilationUnit FileInfo FileData
Index ¶
- func RegisterCompilationAnalyzerServer(s *grpc.Server, srv CompilationAnalyzerServer)
- func RegisterFileDataServiceServer(s *grpc.Server, srv FileDataServiceServer)
- type AnalysisOutput
- type AnalysisRequest
- type CompilationAnalyzerClient
- type CompilationAnalyzerServer
- type CompilationAnalyzer_AnalyzeClient
- type CompilationAnalyzer_AnalyzeServer
- type CompilationUnit
- func (m *CompilationUnit) GetDetails() []*google_protobuf.Any
- func (m *CompilationUnit) GetEnvironment() []*CompilationUnit_Env
- func (m *CompilationUnit) GetRequiredInput() []*CompilationUnit_FileInput
- func (m *CompilationUnit) GetVName() *kythe_proto.VName
- func (*CompilationUnit) ProtoMessage()
- func (m *CompilationUnit) Reset()
- func (m *CompilationUnit) String() string
- type CompilationUnit_ContextDependentVersionColumn
- type CompilationUnit_ContextDependentVersionRow
- func (m *CompilationUnit_ContextDependentVersionRow) GetColumn() []*CompilationUnit_ContextDependentVersionColumn
- func (*CompilationUnit_ContextDependentVersionRow) ProtoMessage()
- func (m *CompilationUnit_ContextDependentVersionRow) Reset()
- func (m *CompilationUnit_ContextDependentVersionRow) String() string
- type CompilationUnit_Env
- type CompilationUnit_FileInput
- func (m *CompilationUnit_FileInput) GetContext() []*CompilationUnit_ContextDependentVersionRow
- func (m *CompilationUnit_FileInput) GetInfo() *FileInfo
- func (m *CompilationUnit_FileInput) GetVName() *kythe_proto.VName
- func (*CompilationUnit_FileInput) ProtoMessage()
- func (m *CompilationUnit_FileInput) Reset()
- func (m *CompilationUnit_FileInput) String() string
- type FileData
- type FileDataServiceClient
- type FileDataServiceServer
- type FileDataService_GetClient
- type FileDataService_GetServer
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCompilationAnalyzerServer ¶
func RegisterCompilationAnalyzerServer(s *grpc.Server, srv CompilationAnalyzerServer)
func RegisterFileDataServiceServer ¶
func RegisterFileDataServiceServer(s *grpc.Server, srv FileDataServiceServer)
Types ¶
type AnalysisOutput ¶
type AnalysisOutput struct {
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}
AnalysisOutput contains an output artifact for the current analysis taking place. A given analysis may not produce any outputs. It is okay for an indexer to send an empty AnalysisOutput message if needed to keep the RPC channel alive; the driver must correctly handle this.
func (*AnalysisOutput) ProtoMessage ¶
func (*AnalysisOutput) ProtoMessage()
func (*AnalysisOutput) Reset ¶
func (m *AnalysisOutput) Reset()
func (*AnalysisOutput) String ¶
func (m *AnalysisOutput) String() string
type AnalysisRequest ¶
type AnalysisRequest struct { // The compilation to analyze. Compilation *CompilationUnit `protobuf:"bytes,1,opt,name=compilation" json:"compilation,omitempty"` // The address of a file data service to use. If this is provided, it should // be used in preference to any other file data service the analyzer may know // about for this compilation. FileDataService string `protobuf:"bytes,2,opt,name=file_data_service" json:"file_data_service,omitempty"` }
An AnalysisRequest instructs an analyzer to perform an analysis on a single CompilationUnit.
func (*AnalysisRequest) GetCompilation ¶
func (m *AnalysisRequest) GetCompilation() *CompilationUnit
func (*AnalysisRequest) ProtoMessage ¶
func (*AnalysisRequest) ProtoMessage()
func (*AnalysisRequest) Reset ¶
func (m *AnalysisRequest) Reset()
func (*AnalysisRequest) String ¶
func (m *AnalysisRequest) String() string
type CompilationAnalyzerClient ¶
type CompilationAnalyzerClient interface { // Analyze is the main entry point for the analysis driver to send work to the // analyzer. The analysis may produce many outputs which will be streamed as // framed AnalysisOutput messages. // // A driver may choose to retry analyses that return RPC errors. It should // not retry analyses that are reported as finished unless it is necessary to // recover from an external production issue. Analyze(ctx context.Context, in *AnalysisRequest, opts ...grpc.CallOption) (CompilationAnalyzer_AnalyzeClient, error) }
func NewCompilationAnalyzerClient ¶
func NewCompilationAnalyzerClient(cc *grpc.ClientConn) CompilationAnalyzerClient
type CompilationAnalyzerServer ¶
type CompilationAnalyzerServer interface { // Analyze is the main entry point for the analysis driver to send work to the // analyzer. The analysis may produce many outputs which will be streamed as // framed AnalysisOutput messages. // // A driver may choose to retry analyses that return RPC errors. It should // not retry analyses that are reported as finished unless it is necessary to // recover from an external production issue. Analyze(*AnalysisRequest, CompilationAnalyzer_AnalyzeServer) error }
type CompilationAnalyzer_AnalyzeClient ¶
type CompilationAnalyzer_AnalyzeClient interface { Recv() (*AnalysisOutput, error) grpc.ClientStream }
type CompilationAnalyzer_AnalyzeServer ¶
type CompilationAnalyzer_AnalyzeServer interface { Send(*AnalysisOutput) error grpc.ServerStream }
type CompilationUnit ¶
type CompilationUnit struct { // The base VName for the compilation and any generated VNames from its // analysis. Generally, the `language` component designates the language of // the compilation's sources. VName *kythe_proto.VName `protobuf:"bytes,1,opt,name=v_name" json:"v_name,omitempty"` // The revision of the compilation. Revision string `protobuf:"bytes,2,opt,name=revision" json:"revision,omitempty"` // All files that might be touched in the course of this compilation. RequiredInput []*CompilationUnit_FileInput `protobuf:"bytes,3,rep,name=required_input" json:"required_input,omitempty"` // Set by the extractor to indicate that the original input had compile // errors. This is used to check validity of the sharded analysis. HasCompileErrors bool `protobuf:"varint,4,opt,name=has_compile_errors" json:"has_compile_errors,omitempty"` // The arguments to pass to a compiler tool for this compilation unit, // including the compiler executable, flags, and input files. Argument []string `protobuf:"bytes,5,rep,name=argument" json:"argument,omitempty"` // Of those files in `required_input`, the ones that this CompilationUnit // is intended to analyze. This is necessary to support languages like Go, // where a single translation unit may contain many source files that must all // be processed at once (while excluding source files that belong to other // CUs/packages, if any). SourceFile []string `protobuf:"bytes,6,rep,name=source_file" json:"source_file,omitempty"` // The output key of the CompilationUnit; for example, the object file that // it writes. // TODO(zarko): should this be a VName? Are there uniqueness requirements? // How is this used in the pipeline? OutputKey string `protobuf:"bytes,7,opt,name=output_key" json:"output_key,omitempty"` // The absolute path of the current working directory where the build tool // was invoked. During analysis, a file whose path has working_directory // plus a path separator as an exact prefix is considered accessible from // that same path without said prefix. It is only necessary to set this // field if the build tool requires it. WorkingDirectory string `protobuf:"bytes,8,opt,name=working_directory" json:"working_directory,omitempty"` // For languages that make use of resource contexts (like C++), the context // that should be initially entered. // TODO(zarko): What is a "resource context"? Needs a clear definition and/or // a link to one. EntryContext string `protobuf:"bytes,9,opt,name=entry_context" json:"entry_context,omitempty"` // A collection of environment variables that the build environment expects // to be set. As a rule, we only record variables here that must be set to // specific values for the build to work. // TODO(fromberger): When we move to NWP, use a map instead. Environment []*CompilationUnit_Env `protobuf:"bytes,10,rep,name=environment" json:"environment,omitempty"` // Per-language or -tool details. Details []*google_protobuf.Any `protobuf:"bytes,11,rep,name=details" json:"details,omitempty"` }
Describes a single unit of compilation.
func (*CompilationUnit) GetDetails ¶
func (m *CompilationUnit) GetDetails() []*google_protobuf.Any
func (*CompilationUnit) GetEnvironment ¶
func (m *CompilationUnit) GetEnvironment() []*CompilationUnit_Env
func (*CompilationUnit) GetRequiredInput ¶
func (m *CompilationUnit) GetRequiredInput() []*CompilationUnit_FileInput
func (*CompilationUnit) GetVName ¶
func (m *CompilationUnit) GetVName() *kythe_proto.VName
func (*CompilationUnit) ProtoMessage ¶
func (*CompilationUnit) ProtoMessage()
func (*CompilationUnit) Reset ¶
func (m *CompilationUnit) Reset()
func (*CompilationUnit) String ¶
func (m *CompilationUnit) String() string
type CompilationUnit_ContextDependentVersionColumn ¶
type CompilationUnit_ContextDependentVersionColumn struct { // The byte offset into the file resource. Offset int32 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` // The signature for the resulting context. LinkedContext string `protobuf:"bytes,2,opt,name=linked_context" json:"linked_context,omitempty"` }
ContextDependentVersionColumn and ContextDependentVersionRow define a table that relates input contexts (keyed by a single source context per row) to tuples of (byte offset * linked context). When a FileInput F being processed in context C refers to another FileInput F' at offset O (perhaps because F has an #include directive at O) the context in which F' should be processed is the linked context derived from this table.
func (*CompilationUnit_ContextDependentVersionColumn) ProtoMessage ¶
func (*CompilationUnit_ContextDependentVersionColumn) ProtoMessage()
func (*CompilationUnit_ContextDependentVersionColumn) Reset ¶
func (m *CompilationUnit_ContextDependentVersionColumn) Reset()
func (*CompilationUnit_ContextDependentVersionColumn) String ¶
func (m *CompilationUnit_ContextDependentVersionColumn) String() string
type CompilationUnit_ContextDependentVersionRow ¶
type CompilationUnit_ContextDependentVersionRow struct { // The context to be applied to all columns. SourceContext string `protobuf:"bytes,1,opt,name=source_context" json:"source_context,omitempty"` // A map from byte offsets to linked contexts. Column []*CompilationUnit_ContextDependentVersionColumn `protobuf:"bytes,2,rep,name=column" json:"column,omitempty"` // If true, this version should always be processed regardless of any // claiming. AlwaysProcess bool `protobuf:"varint,3,opt,name=always_process" json:"always_process,omitempty"` }
See ContextDependentVersionColumn for details. It is valid for a ContextDependentVersionRow to have no columns. In this case, the associated FileInput was seen to exist in some context C, but did not refer to any other FileInputs while in that context.
func (*CompilationUnit_ContextDependentVersionRow) GetColumn ¶
func (m *CompilationUnit_ContextDependentVersionRow) GetColumn() []*CompilationUnit_ContextDependentVersionColumn
func (*CompilationUnit_ContextDependentVersionRow) ProtoMessage ¶
func (*CompilationUnit_ContextDependentVersionRow) ProtoMessage()
func (*CompilationUnit_ContextDependentVersionRow) Reset ¶
func (m *CompilationUnit_ContextDependentVersionRow) Reset()
func (*CompilationUnit_ContextDependentVersionRow) String ¶
func (m *CompilationUnit_ContextDependentVersionRow) String() string
type CompilationUnit_Env ¶
type CompilationUnit_Env struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` }
An Env message represents the name and value of a single environment variable in the build environment.
func (*CompilationUnit_Env) ProtoMessage ¶
func (*CompilationUnit_Env) ProtoMessage()
func (*CompilationUnit_Env) Reset ¶
func (m *CompilationUnit_Env) Reset()
func (*CompilationUnit_Env) String ¶
func (m *CompilationUnit_Env) String() string
type CompilationUnit_FileInput ¶
type CompilationUnit_FileInput struct { // If set, overrides the `v_name` in the `CompilationUnit` for deriving // VNames during analysis. VName *kythe_proto.VName `protobuf:"bytes,1,opt,name=v_name" json:"v_name,omitempty"` // The file's metadata. It is invalid to provide a FileInput without both // the file's path and digest. Info *FileInfo `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` // The file's context-dependent versions. Context []*CompilationUnit_ContextDependentVersionRow `protobuf:"bytes,3,rep,name=context" json:"context,omitempty"` }
func (*CompilationUnit_FileInput) GetContext ¶
func (m *CompilationUnit_FileInput) GetContext() []*CompilationUnit_ContextDependentVersionRow
func (*CompilationUnit_FileInput) GetInfo ¶
func (m *CompilationUnit_FileInput) GetInfo() *FileInfo
func (*CompilationUnit_FileInput) GetVName ¶
func (m *CompilationUnit_FileInput) GetVName() *kythe_proto.VName
func (*CompilationUnit_FileInput) ProtoMessage ¶
func (*CompilationUnit_FileInput) ProtoMessage()
func (*CompilationUnit_FileInput) Reset ¶
func (m *CompilationUnit_FileInput) Reset()
func (*CompilationUnit_FileInput) String ¶
func (m *CompilationUnit_FileInput) String() string
type FileData ¶
type FileData struct { Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` Info *FileInfo `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` }
A FileData describes the content of a single file. A server responding to a FileDataRequest must populate the same path and digest in the reply that were provided by the client in the request, if any. If either field was empty in the request, the server may leave it empty or fill in its value.
func (*FileData) ProtoMessage ¶
func (*FileData) ProtoMessage()
type FileDataServiceClient ¶
type FileDataServiceClient interface { // Get returns the contents of one or more files needed for analysis. It is // the server implementation's responsibility to do any caching that might be // necessary to make this perform well so that an analyzer does not need to // implement its own caches unless it is doing something unusual. // // Except in case of error, the server is required to return at least one of // the requested files; however, the server may also limit how much data is // returned for a single request. If this occurs, any files it does return // must be complete. The client is responsible for issuing additional // requests as necessary to obtain any missing files. For example, the // following is a valid interaction: // // C: Get(a, b, c) // S: FileData(a) // S: FileData(c) // C: Get(b) // S: FileData(b) // Get(ctx context.Context, opts ...grpc.CallOption) (FileDataService_GetClient, error) }
func NewFileDataServiceClient ¶
func NewFileDataServiceClient(cc *grpc.ClientConn) FileDataServiceClient
type FileDataServiceServer ¶
type FileDataServiceServer interface { // Get returns the contents of one or more files needed for analysis. It is // the server implementation's responsibility to do any caching that might be // necessary to make this perform well so that an analyzer does not need to // implement its own caches unless it is doing something unusual. // // Except in case of error, the server is required to return at least one of // the requested files; however, the server may also limit how much data is // returned for a single request. If this occurs, any files it does return // must be complete. The client is responsible for issuing additional // requests as necessary to obtain any missing files. For example, the // following is a valid interaction: // // C: Get(a, b, c) // S: FileData(a) // S: FileData(c) // C: Get(b) // S: FileData(b) // Get(FileDataService_GetServer) error }
type FileInfo ¶
type FileInfo struct { // This path should be relative to the working directory of the compilation // command -- typically the root of the build. // i.e. file/base/file.cc or ../../base/atomic_ref_count.h Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` // The lowercase ascii hex SHA-256 digest of the file contents. Digest string `protobuf:"bytes,2,opt,name=digest" json:"digest,omitempty"` }
A FileInfo specifies metadata for a file under analysis.
func (*FileInfo) ProtoMessage ¶
func (*FileInfo) ProtoMessage()