Documentation
¶
Index ¶
- Constants
- Variables
- func ClusterConfigFile() string
- func CollectorActionPendingDir() string
- func CollectorResInfoSentDir() string
- func CollectorSentDir() string
- func CreateMandatoryDirectories() error
- func DNSUDSDir() string
- func DNSUDSFile() string
- func Load(env map[string]string)
- func MkdirTmp(p string) error
- func NodeConfigFile() string
- func NodeVarDir() string
- func ReloadForTest(rootPath string) func()
- type AgentPaths
- type T
Constants ¶
const (
// Program is the name of the project and module
Program = "opensvc"
)
Variables ¶
var ( Colorize *palette.ColorPaletteFunc Color *palette.ColorPalette Paths AgentPaths SSRFAllowedURL []string SSRFBlockedURL []string SSRFAllowedCIDR []string SSRFBlockedCIDR []string SSRFEnableRedirects bool // BoardLetters is true when the status board marks its notes beyond // the ninth with the superscript letters, so a marker stays one glyph // for longer, and false when it marks them with superscript numbers // only. The OSVC_BOARD_LETTERS variable sets it, true by default. BoardLetters bool )
var ( RegexpScope = regexp.MustCompile(`(@[\w.-_]+)`) RegexpReference = regexp.MustCompile(`({[\w#.-_:]+})`) )
Functions ¶
func ClusterConfigFile ¶
func ClusterConfigFile() string
func CollectorActionPendingDir ¶
func CollectorActionPendingDir() string
CollectorActionPendingDir is the directory holding the begin and end of the local instance actions not yet acknowledged by the collector.
func CollectorResInfoSentDir ¶
func CollectorResInfoSentDir() string
func CollectorSentDir ¶
func CollectorSentDir() string
func CreateMandatoryDirectories ¶
func CreateMandatoryDirectories() error
func DNSUDSFile ¶
func DNSUDSFile() string
func MkdirTmp ¶
MkdirTmp makes the directory p, the temporary directory of the agent or a directory under it, owned by the user of the process and writable by it alone, every directory from the temporary directory of the agent down.
The temporary directory of the agent is under /var/tmp, where every user can write: a user making it first, as after a cleaner removed it, could have the agent write its files through links of theirs. A directory of another user is refused, never taken over: an admin removes it. A directory of the user writable by others is made 0700.
func NodeConfigFile ¶
func NodeConfigFile() string
func NodeVarDir ¶
func NodeVarDir() string
func ReloadForTest ¶
func ReloadForTest(rootPath string) func()
ReloadForTest can be used during tests to force a reload of config after root path populated cleanup function is returned to reset rawconfig from default.
Usage example:
func TestSomething(t *testing.T) {
env := testhelper.Setup(t)
env.InstallFile("../../testdata/cluster.conf", "etc/cluster.conf")
defer rawconfig.ReloadForTest(env.Root)()
...
Types ¶
type AgentPaths ¶
type AgentPaths struct {
Python string `mapstructure:"python"`
Root string `mapstructure:"root"`
Bin string `mapstructure:"bin"`
Var string `mapstructure:"var"`
VarNs string `mapstructure:"varns"`
Lock string `mapstructure:"lock"`
Lsnr string `mapstructure:"lsnr"`
Cache string `mapstructure:"cache"`
Certs string `mapstructure:"certs"`
CACRL string `mapstructure:"cacrl"`
Log string `mapstructure:"log"`
LogNs string `mapstructure:"logns"`
Etc string `mapstructure:"etc"`
EtcNs string `mapstructure:"etcns"`
LastShutdown string `mapstructure:"last_shutdown"`
Capabilities string `mapstructure:"capabilities"`
Run string `mapstructure:"run"`
Tmp string `mapstructure:"tmp"`
TmpNs string `mapstructure:"tmpns"`
Doc string `mapstructure:"doc"`
HTML string `mapstructure:"html"`
Drivers string `mapstructure:"drivers"`
Compliance string `mapstructure:"compliance"`
Backup string `mapstructure:"varbck"`
}
AgentPaths abstracts all paths of the agent file organisation
type T ¶
type T struct {
Data *orderedmap.OrderedMap
}
func (T) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (*T) UnmarshalJSON ¶
UnmarshalJSON unmarshals a quoted json string to the enum value