config

package
v0.0.0-...-df5614f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivateKhulnasoftOssKey       = "ACTIVATE_KHULNASOFT_OPEN_SOURCE"
	ActivateKhulnasoftCodeKey      = "ACTIVATE_KHULNASOFT_CODE"
	ActivateKhulnasoftIacKey       = "ACTIVATE_KHULNASOFT_IAC"
	ActivateKhulnasoftContainerKey = "ACTIVATE_KHULNASOFT_CONTAINER"
	ActivateKhulnasoftAdvisorKey   = "ACTIVATE_KHULNASOFT_ADVISOR"
	SendErrorReportsKey            = "SEND_ERROR_REPORTS"
	Organization                   = "KHULNASOFT_CFG_ORG"
	EnableTelemetry                = "KHULNASOFT_CFG_DISABLE_ANALYTICS"
)
View Source
const (
	FormatHtml = "html"
	FormatMd   = "md"

	DefaultKhulnasoftApiUrl = "https://khulnasoft.com/api"
	DefaultDeeproxyApiUrl   = "https://deeproxy.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) EnableKhulnasoftCodeQuality

func (c *Config) EnableKhulnasoftCodeQuality(activate bool)

func (*Config) EnableKhulnasoftCodeSecurity

func (c *Config) EnableKhulnasoftCodeSecurity(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) IsAutoScanEnabled

func (c *Config) IsAutoScanEnabled() bool

func (*Config) IsErrorReportingEnabled

func (c *Config) IsErrorReportingEnabled() bool

func (*Config) IsFedramp

func (c *Config) IsFedramp() bool

func (*Config) IsKhulnasoftAdvisorEnabled

func (c *Config) IsKhulnasoftAdvisorEnabled() bool

func (*Config) IsKhulnasoftCodeEnabled

func (c *Config) IsKhulnasoftCodeEnabled() bool

func (*Config) IsKhulnasoftCodeQualityEnabled

func (c *Config) IsKhulnasoftCodeQualityEnabled() bool

func (*Config) IsKhulnasoftCodeSecurityEnabled

func (c *Config) IsKhulnasoftCodeSecurityEnabled() bool

func (*Config) IsKhulnasoftContainerEnabled

func (c *Config) IsKhulnasoftContainerEnabled() bool

func (*Config) IsKhulnasoftIacEnabled

func (c *Config) IsKhulnasoftIacEnabled() bool

func (*Config) IsKhulnasoftLearnCodeActionsEnabled

func (c *Config) IsKhulnasoftLearnCodeActionsEnabled() bool

func (*Config) IsKhulnasoftOssEnabled

func (c *Config) IsKhulnasoftOssEnabled() bool

func (*Config) IsTelemetryEnabled

func (c *Config) IsTelemetryEnabled() bool

func (*Config) IsTrustedFolderFeatureEnabled

func (c *Config) IsTrustedFolderFeatureEnabled() bool

func (*Config) KhulnasoftApi

func (c *Config) KhulnasoftApi() string

func (*Config) KhulnasoftCodeAnalysisTimeout

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

func (*Config) KhulnasoftCodeApi

func (c *Config) KhulnasoftCodeApi() string

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) 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) SetKhulnasoftAdvisorEnabled

func (c *Config) SetKhulnasoftAdvisorEnabled(enabled bool)

func (*Config) SetKhulnasoftCodeApi

func (c *Config) SetKhulnasoftCodeApi(khulnasoftCodeApiUrl string)

func (*Config) SetKhulnasoftCodeEnabled

func (c *Config) SetKhulnasoftCodeEnabled(enabled bool)

func (*Config) SetKhulnasoftContainerEnabled

func (c *Config) SetKhulnasoftContainerEnabled(enabled bool)

func (*Config) SetKhulnasoftIacEnabled

func (c *Config) SetKhulnasoftIacEnabled(enabled bool)

func (*Config) SetKhulnasoftLearnCodeActionsEnabled

func (c *Config) SetKhulnasoftLearnCodeActionsEnabled(enabled bool)

func (*Config) SetKhulnasoftOssEnabled

func (c *Config) SetKhulnasoftOssEnabled(enabled bool)

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) 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(khulnasoftApiUrl string) bool

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