Documentation ¶
Index ¶
- Constants
- func FilterFilePattern(regex string, filepath string) (bool, error)
- func FindFilesMatchingPattern(root, pattern string) ([]string, error)
- func FullDepDAGResponse(ctx context.Context, clients []ServiceClient) (map[uri.URI][]DepDAGItem, error)
- func FullDepsResponse(ctx context.Context, clients []ServiceClient) (map[uri.URI][]*Dep, error)
- func GetFiles(configLocation string, filepaths []string, patterns ...string) ([]string, error)
- func HasCapability(caps []Capability, name string) bool
- type AnalysisMode
- type BaseClient
- type Capability
- type Client
- type CodeSnipProvider
- type Config
- type Dep
- type DepDAGItem
- type DependencyCondition
- type ExternalLinks
- type IncidentContext
- type InitConfig
- type InternalInit
- type InternalProviderClient
- type Location
- type Position
- type ProviderCondition
- type ProviderContext
- type ProviderEvaluateResponse
- type Proxy
- type Server
- type ServiceClient
- type Startable
- type UnimplementedDependenciesComponent
Constants ¶
View Source
const ( // Dep source label is a label key that any provider can use, to label the dependencies as coming from a particular source. // Examples from java are: open-source and internal. A provider can also have a user provide file that will tell them which // depdendencies to label as this value. This label will be used to filter out these dependencies from a given analysis DepSourceLabel = "konveyor.io/dep-source" DepLanguageLabel = "konveyor.io/language" DepExcludeLabel = "konveyor.io/exclude" // LspServerPath is a provider specific config used to specify path to a LSP server LspServerPathConfigKey = "lspServerPath" )
Variables ¶
This section is empty.
Functions ¶
func FullDepDAGResponse ¶
func FullDepDAGResponse(ctx context.Context, clients []ServiceClient) (map[uri.URI][]DepDAGItem, error)
func FullDepsResponse ¶
func HasCapability ¶
func HasCapability(caps []Capability, name string) bool
Types ¶
type AnalysisMode ¶
type AnalysisMode string
const ( FullAnalysisMode AnalysisMode = "full" SourceOnlyAnalysisMode AnalysisMode = "source-only" )
type BaseClient ¶
type BaseClient interface { Capabilities() []Capability Init(context.Context, logr.Logger, InitConfig) (ServiceClient, error) }
type Capability ¶
type Client ¶
type Client interface { BaseClient ServiceClient }
type CodeSnipProvider ¶
func (CodeSnipProvider) GetCodeSnip ¶
type Config ¶
type Config struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` BinaryPath string `yaml:"binaryPath,omitempty" json:"binaryPath,omitempty"` Address string `yaml:"address,omitempty" json:"address,omitempty"` Proxy *Proxy `yaml:"proxyConfig,omitempty" json:"proxyConfig,omitempty"` InitConfig []InitConfig `yaml:"initConfig,omitempty" json:"initConfig,omitempty"` ContextLines int }
type Dep ¶
func ConvertDagItemsToList ¶
func ConvertDagItemsToList(items []DepDAGItem) []*Dep
Convert Dag Item List to flat list.
type DepDAGItem ¶
type DepDAGItem = konveyor.DepDAGItem
type DependencyCondition ¶
type DependencyCondition struct { Upperbound string Lowerbound string Name string // NameRegex will be a valid go regex that will be used to // search the name of a given dependency. // Examples include kubernetes* or jakarta-.*-2.2. NameRegex string Client Client LabelSelector *labels.LabelSelector[*Dep] }
TODO where should this go
func (DependencyCondition) Evaluate ¶
func (dc DependencyCondition) Evaluate(ctx context.Context, log logr.Logger, condCtx engine.ConditionContext) (engine.ConditionResponse, error)
type ExternalLinks ¶
type IncidentContext ¶
type IncidentContext struct { FileURI uri.URI `yaml:"fileURI"` Effort *int `yaml:"effort,omitempty"` LineNumber *int `yaml:"lineNumber,omitempty"` Variables map[string]interface{} `yaml:"variables,omitempty"` Links []ExternalLinks `yaml:"externalLink,omitempty"` CodeLocation *Location `yaml:"location,omitempty"` }
type InitConfig ¶
type InitConfig struct { // This is the location of the code base that the // Provider will be responisble for parsing Location string `yaml:"location,omitempty" json:"location,omitempty"` // This is the path to look for the dependencies for the project. // It is relative to the Location DependencyPath string `yaml:"dependencyPath,omitempty" json:"dependencyPath,omitempty"` AnalysisMode AnalysisMode `yaml:"analysisMode" json:"analysisMode"` // This will have to be defined for each provider ProviderSpecificConfig map[string]interface{} `yaml:"providerSpecificConfig,omitempty" json:"providerSpecificConfig,omitempty"` Proxy *Proxy `yaml:"proxyConfig,omitempty" json:"proxyConfig,omitempty"` }
type InternalInit ¶
InternalInit interface is going to be used to init the full config of a provider. used by the engine/analyzer to get a provider ready.
type InternalProviderClient ¶
type InternalProviderClient interface { InternalInit Client }
type Position ¶
type Position struct { /*Line defined: * Line position in a document (zero-based). * If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. * If a line number is negative, it defaults to 0. */ Line float64 `json:"line"` /*Character defined: * Character offset on a line in a document (zero-based). Assuming that the line is * represented as a string, the `character` value represents the gap between the * `character` and `character + 1`. * * If the character value is greater than the line length it defaults back to the * line length. * If a line number is negative, it defaults to 0. */ Character float64 `json:"character"` }
type ProviderCondition ¶
type ProviderCondition struct { Client ServiceClient Capability string ConditionInfo interface{} Rule engine.Rule Ignore bool DepLabelSelector *labels.LabelSelector[*Dep] }
func (ProviderCondition) Evaluate ¶
func (p ProviderCondition) Evaluate(ctx context.Context, log logr.Logger, condCtx engine.ConditionContext) (engine.ConditionResponse, error)
func (ProviderCondition) Ignorable ¶
func (p ProviderCondition) Ignorable() bool
type ProviderContext ¶
type ProviderContext struct { Tags map[string]interface{} `yaml:"tags"` Template map[string]engine.ChainTemplate `yaml:"template"` }
type ProviderEvaluateResponse ¶
type ProviderEvaluateResponse struct { Matched bool `yaml:"matched"` Incidents []IncidentContext `yaml:"incidents"` TemplateContext map[string]interface{} `yaml:"templateContext"` }
func FullResponseFromServiceClients ¶
func FullResponseFromServiceClients(ctx context.Context, clients []ServiceClient, cap string, conditionInfo []byte) (ProviderEvaluateResponse, error)
type Server ¶
type ServiceClient ¶
type ServiceClient interface { Evaluate(ctx context.Context, cap string, conditionInfo []byte) (ProviderEvaluateResponse, error) Stop() // GetDependencies will get the dependencies // It is the responsibility of the provider to determine how that is done GetDependencies(ctx context.Context) (map[uri.URI][]*Dep, error) // GetDependencies will get the dependencies and return them as a linked list // Top level items are direct dependencies, the rest are indirect dependencies GetDependenciesDAG(ctx context.Context) (map[uri.URI][]DepDAGItem, error) }
For some period of time during POC this will be in tree, in the future we need to write something that can do this w/ external binaries
type UnimplementedDependenciesComponent ¶
type UnimplementedDependenciesComponent struct{}
func (*UnimplementedDependenciesComponent) GetDependencies ¶
func (p *UnimplementedDependenciesComponent) GetDependencies(ctx context.Context) (map[uri.URI][]*Dep, error)
We don't have dependencies
func (*UnimplementedDependenciesComponent) GetDependenciesDAG ¶
func (p *UnimplementedDependenciesComponent) GetDependenciesDAG(ctx context.Context) (map[uri.URI][]DepDAGItem, error)
We don't have dependencies
Click to show internal directories.
Click to hide internal directories.