An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.6% on proxy.golang.org

proxy.golang.org : github.com/mohae/contour

Package contour: a package for storing settings. These settings may be configuration settings or application settings. Application settings are either Core or Basic settings. Core settings cannot be modified once Added with AddCore functions. Basic settings are set by Add functions and can be updated with Update functions. These settings are not exposed as configuration file variables, environment variables, or flags. They cannot be modified by any of them. Configuration settings are settings that are updateable by one or more of the following, depending on what type of configuration setting they are, in order of override precedence: configuration file variable, environment variable, and flag. Configuration settings are registered. They are registered with default values and are overridable according to their configuration setting type. For custom override properties, e.g. can be set by either a configuration file or a flag but not by an environment variable, use the Register function. Registering a configuration setting will result in settings being configured to use that setting type's source, along with any lower precedence sources during the Set process, e.g. registering a ConfFileVar will result in settings being configured to use a configuration file and registering a Flag will result in settings being configured to use a configuration file and check environment variables. After registration, settings can be set to ignore certain configuration sources using the SetUseConfFile and SetUseEnvVars methods. Flag parsing is always explicitly done by the caller with the ParseFlags method. The configuration file can be explicitly set, in which case the configuration file format will be inferred from the extension with unknown extensions resulting in an UnsupportedFormatError. If there are configuration settings registered, of any type, and the configuration file has not been set, it will be assumed to be SettingsName.Format where SettingsName is the name of the settings and Format is the configuration file format that settings is set to use, which defaults to JSON. The format can be set using the SetFormat method. This only needs to be done if the configuration file is not explictly set using the SetConfFilename method. The supported configuration formats are: JSON, TOML, and YAML. A settings can also be configured to search for the configuration file until it is found. Where it looks depends on how it has been configured and what additional information the settings has been provided: By default, a missing configuration file results in an os.PathError with a list of all paths that were checked along with an os.IsNotExist error. A settings can be set to not return an error when the configuration file cannot be found by using the SetErrOnMissingConfFile method. Contour only saves the top level keys of configuration files as settings. For configuration file settings that are arrays, maps, or objects, their values will be saved as an interface{}. Environment variables are UPPER CASE and use a NAME_KEY as the variable name, where NAME is the name of the Settings, the executable name for the package global Settings, and KEY is the name, or key, of the setting. Flags can be registered with either a short flag or alias using the short parameter of Register Flag functions. All operations are thread-safe. The workflow for application configurations is: Non-configuration application settings, Core and Basic, can be added at anytime. For convenience, there's a predefined 'standard' Settings, whose name is the executable's name.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/mohae/contour
License: MIT
Latest release: over 8 years ago
First release: over 8 years ago
Namespace: github.com/mohae
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 months ago

    Loading...
    Readme
    Loading...