config

package
v0.0.0-...-ddadb11 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed prometheus.yml.template
	PrometheusConfig string

	//go:embed prometheus-web-config.yml.template
	WebConfigForPrometheus string
)
View Source
var (
	//go:embed startsh-podman.template
	StartScriptPodmanTemplate string

	//go:embed stopsh-podman.template
	StopScriptPodmanTemplate string
)
View Source
var (
	Platform string
)
View Source
var (
	PlatformConfigFile = path.Join(GetDataHome(), "platform.yaml")
)
View Source
var (
	//go:embed systemd_service.template
	SystemdServiceTemplate string
)

Functions

func GetCmdDisableSystemdService

func GetCmdDisableSystemdService(serviceName string) *exec.Cmd

func GetCmdEnableSystemdService

func GetCmdEnableSystemdService(serviceName string) *exec.Cmd

func GetCmdIsSystemdEnabled

func GetCmdIsSystemdEnabled() *exec.Cmd

func GetCmdReloadSystemdDaemon

func GetCmdReloadSystemdDaemon() *exec.Cmd

func GetCmdResetFailedSystemService

func GetCmdResetFailedSystemService(serviceName string) *exec.Cmd

func GetCmdStartSystemdService

func GetCmdStartSystemdService(serviceName string) *exec.Cmd

func GetCmdStopSystemdService

func GetCmdStopSystemdService(serviceName string) *exec.Cmd

func GetConfigHome

func GetConfigHome() string

func GetDataHome

func GetDataHome() string

func GetPlatform

func GetPlatform() types.Platform

func GetRuntimeDir

func GetRuntimeDir() string

func HashPrometheusPassword

func HashPrometheusPassword(password string) ([]byte, error)

func IsLingeringEnabled

func IsLingeringEnabled(user string) bool

func IsSystemdUserEnabled

func IsSystemdUserEnabled() bool

func NewSystemdServiceInfo

func NewSystemdServiceInfo(platform types.Platform) *systemdServiceInfo

func ScrapeConfigForPrometheus

func ScrapeConfigForPrometheus(info PrometheusInfo) string

func ScrapeWebConfigForPrometheus

func ScrapeWebConfigForPrometheus(info PrometheusInfo) string

Types

type ConfigFileHandler

type ConfigFileHandler interface {
	GetFilename() string
	SetFileName(name string)
	Save() error
	Load() error
	GetData() interface{}
	SetData(data interface{})
}

type ConfigFileHandlerCommon

type ConfigFileHandlerCommon struct {
	// contains filtered or unexported fields
}

func (*ConfigFileHandlerCommon) GetData

func (l *ConfigFileHandlerCommon) GetData() interface{}

func (*ConfigFileHandlerCommon) GetFilename

func (l *ConfigFileHandlerCommon) GetFilename() string

func (*ConfigFileHandlerCommon) Load

func (l *ConfigFileHandlerCommon) Load() error

func (*ConfigFileHandlerCommon) Save

func (l *ConfigFileHandlerCommon) Save() error

func (*ConfigFileHandlerCommon) SetData

func (l *ConfigFileHandlerCommon) SetData(data interface{})

func (*ConfigFileHandlerCommon) SetFileName

func (l *ConfigFileHandlerCommon) SetFileName(name string)

type PlatformInfo

type PlatformInfo struct {
	Current  types.Platform `yaml:"current"`
	Previous types.Platform `yaml:"previous"`
}

func (*PlatformInfo) Load

func (p *PlatformInfo) Load() error

func (*PlatformInfo) Update

func (p *PlatformInfo) Update(platform types.Platform) error

type PrometheusInfo

type PrometheusInfo struct {
	BasicAuth   bool
	TlsAuth     bool
	ServiceName string
	Namespace   string
	Port        string
	User        string
	Password    string
	Hash        string
}

type StartupScripts

type StartupScripts struct {
	StartScript string
	StopScript  string
	Platform    types.Platform
}

func GetStartupScripts

func GetStartupScripts(platform types.Platform) *StartupScripts

func (*StartupScripts) Create

func (s *StartupScripts) Create() error

func (*StartupScripts) GetPath

func (s *StartupScripts) GetPath() string

func (*StartupScripts) GetStartFileName

func (s *StartupScripts) GetStartFileName() string

func (*StartupScripts) GetStopFileName

func (s *StartupScripts) GetStopFileName() string

func (*StartupScripts) Remove

func (s *StartupScripts) Remove()

Jump to

Keyboard shortcuts

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