Documentation ¶
Overview ¶
Package config implements application-level configuration functionality.
It works by loading configuration sources (e.g. CLI flags, configuration files, local VCS) and providing functions which compute relevant configuration values from these sources.
This design is intended to make how a particular value is computed very clear. All values can have their computation strategy modified independently of all other values. It should also be easy to determine which source set a particular configuration value.
Index ¶
- Constants
- Variables
- func APIKey() string
- func BoolFlag(name string) bool
- func Branch() string
- func Debug() bool
- func Endpoint() string
- func ExistsFile() (bool, error)
- func Fetcher() string
- func Filepath() string
- func Interactive() bool
- func JIRAProjectKey() string
- func Link() string
- func Modules() ([]module.Module, error)
- func Options() (map[string]interface{}, error)
- func Policy() string
- func Project() string
- func ProjectURL() string
- func ReleaseGroup() string
- func ReleaseGroupVersion() string
- func Revision() string
- func SetContext(c *cli.Context) error
- func StringFlag(name string) string
- func Team() string
- func Title() string
- func TryFiles(candidates ...string) (string, error)
- func TryStrings(candidates ...string) string
- func UpdateFile(modules []module.Module) error
- func Verbose() bool
- func Version() int
- func WriteFile(modules []module.Module) error
- type File
- type NoFile
- func (_ NoFile) APIKey() string
- func (_ NoFile) Branch() string
- func (_ NoFile) Fetcher() string
- func (_ NoFile) GetVersion() int
- func (_ NoFile) JIRAProjectKey() string
- func (_ NoFile) Link() string
- func (_ NoFile) Modules() []module.Module
- func (_ NoFile) Policy() string
- func (_ NoFile) Project() string
- func (_ NoFile) ProjectURL() string
- func (_ NoFile) ReleaseGroup() string
- func (_ NoFile) ReleaseGroupVersion() string
- func (_ NoFile) Revision() string
- func (_ NoFile) Server() string
- func (_ NoFile) Team() string
- func (_ NoFile) Title() string
Constants ¶
const DefaultEndpoint = "https://app.fossa.com"
Variables ¶
var ErrFileNotFound = errors.New("no files existed")
var (
MockBranch string
)
*** Mock configuration values ***
Functions ¶
func Debug ¶ added in v0.7.0
func Debug() bool
Debug is true if the user has requested debug-level logging.
func Endpoint ¶ added in v0.7.0
func Endpoint() string
Endpoint is the desired FOSSA backend endpoint.
func ExistsFile ¶ added in v0.7.0
func Interactive ¶ added in v0.7.0
func Interactive() bool
Interactive is true if the user desires interactive output.
func JIRAProjectKey ¶ added in v0.7.6
func JIRAProjectKey() string
func ProjectURL ¶ added in v0.7.6
func ProjectURL() string
func ReleaseGroup ¶ added in v1.1.2
func ReleaseGroup() string
func ReleaseGroupVersion ¶ added in v1.1.2
func ReleaseGroupVersion() string
func SetContext ¶ added in v0.7.6
SetContext initializes application-level configuration.
func StringFlag ¶ added in v0.7.0
func TryStrings ¶ added in v0.7.0
func UpdateFile ¶ added in v0.7.0
Types ¶
type File ¶ added in v0.7.0
type File interface { GetVersion() int APIKey() string Server() string Title() string Fetcher() string Project() string Branch() string Revision() string ProjectURL() string JIRAProjectKey() string Link() string Team() string Policy() string ReleaseGroup() string ReleaseGroupVersion() string Modules() []module.Module }
File defines the minimum interface for usage as a configuration file. We use an interface here in anticipation of new versions of configuration files, which will likely be implemented as different structs.
type NoFile ¶ added in v0.7.0
type NoFile struct{}