Documentation
¶
Index ¶
- Constants
- func BalanceMemory(services []ServiceConfig, totalMemory int) (map[string]*ServiceConfig, error)
- func CheckCPU(cores int) error
- func CheckDisk(size uint64) error
- func CheckDistro(distro string) error
- func CheckMem(size uint64) error
- func CreatePathIfNotExist(path string) error
- func GenerateCerts(folder string) error
- func GenerateConfig(variables interface{}, text, output string) error
- func GenerateSecret(size int) string
- func GetLock(v int, locksDir string) bool
- func GetMainIP() (string, error)
- func GetMainIface(mainIP string) (string, error)
- func GetOddValue(value int) int
- func GetStep() int
- func MakeDir(mode os.FileMode, arg ...string) string
- func Mode(mode string, options map[string]interface{}) interface{}
- func ParseTemplate(text string, data interface{}) (*bytes.Buffer, error)
- func Remove(path string) error
- func RunCmd(command string, arg ...string) error
- func RunEnvCmd(env []string, command string, arg ...string) error
- func SetLock(v int, locksDir string) error
- func Str(s string) *string
- func WriteYAML(url string, data interface{}) error
- type ServiceConfig
Constants ¶
View Source
const (
SYSTEM_RESERVED_MEMORY = 1.4 * 1000
)
Variables ¶
This section is empty.
Functions ¶
func BalanceMemory ¶
func BalanceMemory(services []ServiceConfig, totalMemory int) (map[string]*ServiceConfig, error)
func CheckDistro ¶
func CreatePathIfNotExist ¶
func GenerateCerts ¶
func GenerateConfig ¶
GenerateConfig generates a configuration file from a text template.
The `variables` argument is a map of variables to be used in the template. The `text` argument is the text of the template. The `output` argument is the path to the output file.
The function returns an error if there is any problem generating the configuration file.
func GenerateSecret ¶
func GetMainIface ¶
func GetOddValue ¶
func ParseTemplate ¶
ParseTemplate parses a template and executes it with the given data.
text: The text of the template. data: The data to use to render the template.
Returns: A bytes.Buffer containing the rendered template, or an error if parsing or execution failed.
Types ¶
Click to show internal directories.
Click to hide internal directories.