rawconfig

package
v3.0.0-beta13 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	RegexpScope     = regexp.MustCompile(`(@[\w.-_]+)`)
	RegexpReference = regexp.MustCompile(`({[\w#.-_:]+})`)
)

Functions

func ClusterConfigFile

func ClusterConfigFile() 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 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