Documentation
¶
Index ¶
- Constants
- Variables
- func ResetInstance()
- type Config
- func (c *Config) AddRecentScanRoot(path string) error
- func (c *Config) GetApiToken() string
- func (c *Config) GetApiUrl() string
- func (c *Config) GetDebug() bool
- func (c *Config) GetDefaultConfigFolder() string
- func (c *Config) GetRecentScanRoots() []string
- func (c *Config) GetResultFilePath() string
- func (c *Config) GetScanRoot() string
- func (c *Config) GetScanSettingsFilePath() string
- func (c *Config) InitializeConfig(cfgFile, scanRoot, apiKey, apiUrl, inputFile, scanossSettingsFilePath string, ...) error
- func (c *Config) MarshalJSON() ([]byte, error)
- func (c *Config) RegisterListener(listener func(*Config))
- func (c *Config) SetApiToken(token string) error
- func (c *Config) SetApiUrl(url string) error
- func (c *Config) SetDebug(debug bool)
- func (c *Config) SetRecentScanRoots(roots []string)
- func (c *Config) SetResultFilePath(path string)
- func (c *Config) SetScanRoot(path string)
- func (c *Config) SetScanSettingsFilePath(path string)
- func (c *Config) UnmarshalJSON(data []byte) error
- type ConfigDTO
Constants ¶
View Source
const ( 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") )
View Source
var DefaultAPIURL = "https://api.osskb.org"
DefaultAPIURL Build-time overridable default. Can be set with: go build -ldflags "-X 'github.com/scanoss/scanoss.cc/internal/config.DefaultAPIURL=https://...'"
Functions ¶
func ResetInstance ¶ added in v0.7.4
func ResetInstance()
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance() *Config
func (*Config) AddRecentScanRoot ¶ added in v0.6.2
func (*Config) GetApiToken ¶ added in v0.6.0
func (*Config) GetDefaultConfigFolder ¶ added in v0.6.0
func (*Config) GetRecentScanRoots ¶ added in v0.6.2
func (*Config) GetResultFilePath ¶ added in v0.6.0
func (*Config) GetScanRoot ¶ added in v0.6.0
func (*Config) GetScanSettingsFilePath ¶ added in v0.6.0
func (*Config) InitializeConfig ¶ added in v0.6.0
func (*Config) MarshalJSON ¶ added in v0.6.1
func (*Config) RegisterListener ¶ added in v0.6.0
func (*Config) SetApiToken ¶
func (*Config) SetRecentScanRoots ¶ added in v0.6.2
func (*Config) SetResultFilePath ¶
func (*Config) SetScanRoot ¶
func (*Config) SetScanSettingsFilePath ¶
func (*Config) UnmarshalJSON ¶ added in v0.6.1
type ConfigDTO ¶ added in v0.6.1
type ConfigDTO struct {
ApiToken string `json:"apitoken"`
ApiUrl string `json:"apiurl"`
ResultFilePath string `json:"resultfilepath,omitempty"`
ScanRoot string `json:"scanroot,omitempty"`
ScanSettingsFilePath string `json:"scansettingsfilepath,omitempty"`
RecentScanRoots []string `json:"recentscanroots,omitempty"`
Debug bool `json:"debug,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.