rawconfig

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Program is the name of the project and module
	Program = "opensvc"
)

Variables

View Source
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
)
View Source
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 DNSUDSDir

func DNSUDSDir() string

func DNSUDSFile

func DNSUDSFile() string

func Load

func Load(env map[string]string)

func MkdirTmp

func MkdirTmp(p string) error

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 New

func New() T

func (T) Filter

func (t T) Filter(keys []string) T

func (T) IsZero

func (t T) IsZero() bool

IsZero returns true if the Raw data has not been initialized

func (T) MarshalJSON

func (t T) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (T) Render

func (t T) Render() string

Render return a colorized text version of the configuration file

func (T) String

func (t T) String() string

func (*T) UnmarshalJSON

func (t *T) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals a quoted json string to the enum value

Jump to

Keyboard shortcuts

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