config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_API_URL               = "https://api.osskb.org"
	DEFAULT_RESULTS_FILE          = "results.json"
	DEFAULT_SCANOSS_SETTINGS_FILE = "scanoss.json"
	DEFAULT_CONFIG_FILE_NAME      = "scanoss-cc-settings"
	DEFAULT_CONFIG_FILE_TYPE      = "json"
	ROOT_FOLDER                   = "."
	SCANOSS_HIDDEN_FOLDER         = ".scanoss"
	SCANOSS_PREMIUM_API_URL       = "https://api.scanoss.com"
)

Variables

View Source
var (
	ErrReadingFile       = errors.New("error reading file")
	ErrUnmarshallingFile = errors.New("error unmarshalling file")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiToken             string `json:"apitoken"`
	ApiUrl               string `json:"apiurl"`
	ResultFilePath       string `json:"resultfilepath,omitempty"`
	ScanRoot             string `json:"scanroot,omitempty"`
	ScanSettingsFilePath string `json:"scansettingsfilepath,omitempty"`
	Debug                bool   `json:"debug,omitempty"`
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Config

func (*Config) GetApiToken added in v0.6.0

func (c *Config) GetApiToken() string

func (*Config) GetApiUrl added in v0.6.0

func (c *Config) GetApiUrl() string

func (*Config) GetDefaultConfigFolder added in v0.6.0

func (c *Config) GetDefaultConfigFolder() string

func (*Config) GetResultFilePath added in v0.6.0

func (c *Config) GetResultFilePath() string

func (*Config) GetScanRoot added in v0.6.0

func (c *Config) GetScanRoot() string

func (*Config) GetScanSettingsFilePath added in v0.6.0

func (c *Config) GetScanSettingsFilePath() string

func (*Config) InitializeConfig added in v0.6.0

func (c *Config) InitializeConfig(cfgFile, scanRoot, apiKey, apiUrl, inputFile, scanossSettingsFilePath string, originalWorkDir string, debug bool) error

func (*Config) RegisterListener added in v0.6.0

func (c *Config) RegisterListener(listener func(*Config))

func (*Config) SetApiToken

func (c *Config) SetApiToken(token string) error

func (*Config) SetApiUrl

func (c *Config) SetApiUrl(url string) error

func (*Config) SetResultFilePath

func (c *Config) SetResultFilePath(path string)

func (*Config) SetScanRoot

func (c *Config) SetScanRoot(path string)

func (*Config) SetScanSettingsFilePath

func (c *Config) SetScanSettingsFilePath(path string)

Jump to

Keyboard shortcuts

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