cmd

package
v4.7.2 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd provides some common information to clair's binaries.

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version is a version string, injected at release time for release builds.

Functions

func LoadConfig added in v4.7.0

func LoadConfig(cfg *config.Config, name string, strict bool) error

LoadConfig loads the named config file or reports an error.

JSON and YAML formatted files are supported, as determined by the file extension ("json" or "yaml" -- "yml" is not supported). If a directory suffixed with ".d" exists (e.g. a file "config.json" and a directory "config.json.d"), then all files with the same extension or the same extension suffixed with "-patch" will be loaded in lexical order and merged with the main configuration or applied as an RFC6902 patch, respectively.

For example, given the paths:

config.yaml
config.yaml.d/
config.yaml.d/secrets.yaml
config.yaml.d/override.yaml-patch
config.yaml.d/unloved.json-patch

"Config.yaml" will be the base config, "override.yaml-patch" will be applied as a patch to the base config, "secrets.yaml" will be merged into the base config, and "unloved.json-patch" will be ignored.

The "strict" argument controls whether the function returns on the first error, or runs the full routine and returns all accumulated errors at the end.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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