config

package
v0.0.0-...-dfd24c6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ActivateVulnmapOssKey       = "ACTIVATE_VULNMAP_OPEN_SOURCE"
	ActivateVulnmapCodeKey      = "ACTIVATE_VULNMAP_CODE"
	ActivateVulnmapIacKey       = "ACTIVATE_VULNMAP_IAC"
	ActivateVulnmapContainerKey = "ACTIVATE_VULNMAP_CONTAINER"
	ActivateVulnmapAdvisorKey   = "ACTIVATE_VULNMAP_ADVISOR"
	SendErrorReportsKey         = "SEND_ERROR_REPORTS"
	Organization                = "VULNMAP_CFG_ORG"
	EnableTelemetry             = "VULNMAP_CFG_DISABLE_ANALYTICS"
)
View Source
const (
	FormatHtml = "html"
	FormatMd   = "md"

	DefaultVulnmapApiUrl  = "https://vulnmap.khulnasoft.com/api"
	DefaultDeeproxyApiUrl = "https://deeproxy.vulnmap.khulnasoft.com"
)

Variables

View Source
var (
	Version           = "SNAPSHOT"
	LsProtocolVersion = "development"
	Development       = "true"

	LicenseInformation = "License information\n FILLED DURING BUILD"
)

Functions

func IsDevelopment

func IsDevelopment() bool

func SetCurrentConfig

func SetCurrentConfig(config *Config)

func WithCallbacks

func WithCallbacks(callbacks map[string]StorageCallbackFunc) func(*storage)

Types

type CliSettings

type CliSettings struct {
	Insecure                bool
	AdditionalOssParameters []string
	// contains filtered or unexported fields
}

func NewCliSettings

func NewCliSettings() *CliSettings

func (*CliSettings) DefaultBinaryInstallPath

func (c *CliSettings) DefaultBinaryInstallPath() string

func (*CliSettings) Installed

func (c *CliSettings) Installed() bool

func (*CliSettings) IsPathDefined

func (c *CliSettings) IsPathDefined() bool

func (*CliSettings) Path

func (c *CliSettings) Path() string

Path returns the full path to the CLI executable that is stored in the CLI configuration

func (*CliSettings) SetPath

func (c *CliSettings) SetPath(path string)

type Config

type Config struct {
	// contains filtered or unexported fields
}

func CurrentConfig

func CurrentConfig() *Config

func New

func New() *Config

New creates a configuration object with default values

func (*Config) AddBinaryLocationsToPath

func (c *Config) AddBinaryLocationsToPath(searchDirectories []string)

func (*Config) AuthenticationMethod

func (c *Config) AuthenticationMethod() lsp.AuthenticationMethod

func (*Config) AutomaticAuthentication

func (c *Config) AutomaticAuthentication() bool

func (*Config) CLIDownloadLockFileName

func (c *Config) CLIDownloadLockFileName() string

func (*Config) CliSettings

func (c *Config) CliSettings() *CliSettings

func (*Config) ClientCapabilities

func (c *Config) ClientCapabilities() lsp.ClientCapabilities

func (*Config) ConfigureLogging

func (c *Config) ConfigureLogging(server lsp.Server)

func (*Config) DeviceID

func (c *Config) DeviceID() string

func (*Config) DisableLoggingToFile

func (c *Config) DisableLoggingToFile()

DisableLoggingToFile closes the open log file and sets the global logger back to it's default

func (*Config) DisplayableIssueTypes

func (c *Config) DisplayableIssueTypes() map[product.FilterableIssueType]bool

func (*Config) EnableVulnmapCodeQuality

func (c *Config) EnableVulnmapCodeQuality(activate bool)

func (*Config) EnableVulnmapCodeSecurity

func (c *Config) EnableVulnmapCodeSecurity(activate bool)

func (*Config) Engine

func (c *Config) Engine() workflow.Engine

func (*Config) FilterSeverity

func (c *Config) FilterSeverity() lsp.SeverityFilter

func (*Config) FindBinaryInDirs

func (c *Config) FindBinaryInDirs(binaryName string) (foundPath string)

func (*Config) Format

func (c *Config) Format() string

func (*Config) IdeName

func (c *Config) IdeName() string

func (*Config) IdeVersion

func (c *Config) IdeVersion() string

func (*Config) IntegrationName

func (c *Config) IntegrationName() string

func (*Config) IntegrationVersion

func (c *Config) IntegrationVersion() string

func (*Config) IsAnalyticsEnabled

func (c *Config) IsAnalyticsEnabled() bool

func (*Config) IsAutoScanEnabled

func (c *Config) IsAutoScanEnabled() bool

func (*Config) IsErrorReportingEnabled

func (c *Config) IsErrorReportingEnabled() bool

func (*Config) IsFedramp

func (c *Config) IsFedramp() bool

func (*Config) IsTelemetryEnabled

func (c *Config) IsTelemetryEnabled() bool

func (*Config) IsTrustedFolderFeatureEnabled

func (c *Config) IsTrustedFolderFeatureEnabled() bool

func (*Config) IsVulnmapAdvisorEnabled

func (c *Config) IsVulnmapAdvisorEnabled() bool

func (*Config) IsVulnmapCodeEnabled

func (c *Config) IsVulnmapCodeEnabled() bool

func (*Config) IsVulnmapCodeQualityEnabled

func (c *Config) IsVulnmapCodeQualityEnabled() bool

func (*Config) IsVulnmapCodeSecurityEnabled

func (c *Config) IsVulnmapCodeSecurityEnabled() bool

func (*Config) IsVulnmapContainerEnabled

func (c *Config) IsVulnmapContainerEnabled() bool

func (*Config) IsVulnmapIacEnabled

func (c *Config) IsVulnmapIacEnabled() bool

func (*Config) IsVulnmapLearnCodeActionsEnabled

func (c *Config) IsVulnmapLearnCodeActionsEnabled() bool

func (*Config) IsVulnmapOssEnabled

func (c *Config) IsVulnmapOssEnabled() bool

func (*Config) Load

func (c *Config) Load()

func (*Config) LogLevel

func (c *Config) LogLevel() string

func (*Config) LogPath

func (c *Config) LogPath() string

func (*Config) Logger

func (c *Config) Logger() *zerolog.Logger

func (*Config) ManageBinariesAutomatically

func (c *Config) ManageBinariesAutomatically() bool

func (*Config) ManageCliBinariesAutomatically

func (c *Config) ManageCliBinariesAutomatically() bool

func (*Config) NonEmptyToken

func (c *Config) NonEmptyToken() bool

func (*Config) Organization

func (c *Config) Organization() string

func (*Config) OsArch

func (c *Config) OsArch() string

func (*Config) OsPlatform

func (c *Config) OsPlatform() string

func (*Config) Path

func (c *Config) Path() string

func (*Config) RuntimeName

func (c *Config) RuntimeName() string

func (*Config) RuntimeVersion

func (c *Config) RuntimeVersion() string

func (*Config) SetAnalyticsEnabled

func (c *Config) SetAnalyticsEnabled(enableAnalytics bool)

func (*Config) SetAuthenticationMethod

func (c *Config) SetAuthenticationMethod(method lsp.AuthenticationMethod)

func (*Config) SetAutomaticAuthentication

func (c *Config) SetAutomaticAuthentication(value bool)

func (*Config) SetAutomaticScanning

func (c *Config) SetAutomaticScanning(value bool)

func (*Config) SetCliSettings

func (c *Config) SetCliSettings(settings *CliSettings)

func (*Config) SetClientCapabilities

func (c *Config) SetClientCapabilities(capabilities lsp.ClientCapabilities)

func (*Config) SetConfigFile

func (c *Config) SetConfigFile(configFile string)

func (*Config) SetDeviceID

func (c *Config) SetDeviceID(deviceId string)

func (*Config) SetEngine

func (c *Config) SetEngine(engine workflow.Engine)

func (*Config) SetErrorReportingEnabled

func (c *Config) SetErrorReportingEnabled(enabled bool)

func (*Config) SetFormat

func (c *Config) SetFormat(format string)

func (*Config) SetIdeName

func (c *Config) SetIdeName(ideName string)

func (*Config) SetIdeVersion

func (c *Config) SetIdeVersion(ideVersion string)

func (*Config) SetIntegrationName

func (c *Config) SetIntegrationName(integrationName string)

func (*Config) SetIntegrationVersion

func (c *Config) SetIntegrationVersion(integrationVersion string)

func (*Config) SetLogLevel

func (c *Config) SetLogLevel(level string)

func (*Config) SetLogPath

func (c *Config) SetLogPath(logPath string)

func (*Config) SetManageBinariesAutomatically

func (c *Config) SetManageBinariesAutomatically(enabled bool)

func (*Config) SetOrganization

func (c *Config) SetOrganization(organization string)

func (*Config) SetOsArch

func (c *Config) SetOsArch(osArch string)

func (*Config) SetOsPlatform

func (c *Config) SetOsPlatform(osPlatform string)

func (*Config) SetRuntimeName

func (c *Config) SetRuntimeName(runtimeName string)

func (*Config) SetRuntimeVersion

func (c *Config) SetRuntimeVersion(runtimeVersion string)

func (*Config) SetSeverityFilter

func (c *Config) SetSeverityFilter(severityFilter lsp.SeverityFilter) bool

func (*Config) SetTelemetryEnabled

func (c *Config) SetTelemetryEnabled(enabled bool)

func (*Config) SetToken

func (c *Config) SetToken(token string)

func (*Config) SetTrustedFolderFeatureEnabled

func (c *Config) SetTrustedFolderFeatureEnabled(enabled bool)

func (*Config) SetTrustedFolders

func (c *Config) SetTrustedFolders(folderPaths []string)

func (*Config) SetVulnmapAdvisorEnabled

func (c *Config) SetVulnmapAdvisorEnabled(enabled bool)

func (*Config) SetVulnmapCodeApi

func (c *Config) SetVulnmapCodeApi(vulnmapCodeApiUrl string)

func (*Config) SetVulnmapCodeEnabled

func (c *Config) SetVulnmapCodeEnabled(enabled bool)

func (*Config) SetVulnmapContainerEnabled

func (c *Config) SetVulnmapContainerEnabled(enabled bool)

func (*Config) SetVulnmapIacEnabled

func (c *Config) SetVulnmapIacEnabled(enabled bool)

func (*Config) SetVulnmapLearnCodeActionsEnabled

func (c *Config) SetVulnmapLearnCodeActionsEnabled(enabled bool)

func (*Config) SetVulnmapOssEnabled

func (c *Config) SetVulnmapOssEnabled(enabled bool)

func (*Config) Storage

func (c *Config) Storage() StorageWithCallbacks

func (*Config) Token

func (c *Config) Token() string

func (*Config) TokenAsOAuthToken

func (c *Config) TokenAsOAuthToken() (oauth2.Token, error)

func (*Config) TokenChangesChannel

func (c *Config) TokenChangesChannel() <-chan string

TokenChangesChannel returns a channel that will be written into once the token has changed. This allows aborting operations when the token is changed.

func (*Config) TrustedFolders

func (c *Config) TrustedFolders() []string

func (*Config) UpdateApiEndpoints

func (c *Config) UpdateApiEndpoints(vulnmapApiUrl string) bool

func (*Config) VulnmapApi

func (c *Config) VulnmapApi() string

func (*Config) VulnmapCodeAnalysisTimeout

func (c *Config) VulnmapCodeAnalysisTimeout() time.Duration

func (*Config) VulnmapCodeApi

func (c *Config) VulnmapCodeApi() string

type StorageCallbackFunc

type StorageCallbackFunc func(string, any)

type StorageWithCallbacks

type StorageWithCallbacks interface {
	configuration.Storage
	RegisterCallback(key string, callback StorageCallbackFunc)
	UnRegisterCallback(key string)
}

func NewStorage

func NewStorage(opts ...storageOption) StorageWithCallbacks

Jump to

Keyboard shortcuts

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