lib

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDeploymentFile

func AddDeploymentFile(filePath string) error

AddDeploymentFile copy deployment file to config dir and validates. Returns error message if file doesn't exist or is invalid.

func CheckBootTime

func CheckBootTime()

CheckBootTime update boot time in state.ini and delete all processes from "processes" section if boot time changes.

func CopyFile

func CopyFile(src, dst string) (int64, error)

CopyFile from src to dst

func DeleteDeployment

func DeleteDeployment(deploymentName string) error

DeleteDeployment TODO

func ForegroundDeployments

func ForegroundDeployments()

ForegroundDeployments keep running and respawn all deployments

func GetState

func GetState() *ini.File

GetState return the ini object.

func HasDeployment

func HasDeployment(deploymentName string) bool

HasDeployment if deployment does exist.

func HasLettersOnly

func HasLettersOnly(s string) bool

HasLettersOnly returns true if all string is letters

func RefactorAllDeploymentFile

func RefactorAllDeploymentFile()

RefactorAllDeploymentFile check all content and update values based on DeploymentData struct of all files

func RefactorDeploymentFile

func RefactorDeploymentFile(deploymentName string)

RefactorDeploymentFile check all content and update values based on DeploymentData struct

func RestartDeployment

func RestartDeployment(deploymentName string) error

RestartDeployment TODO

func ShowAvailableMemory

func ShowAvailableMemory()

ShowAvailableMemory prints the available memory

func SimpleCommandInvoker

func SimpleCommandInvoker(commandName string, args []string) int

SimpleCommandInvoker and add it to a pull

func StartDeployment

func StartDeployment(deploymentName string)

StartDeployment if is not running

func StopDeployment

func StopDeployment(deploymentName string) error

StopDeployment and returns nil if no error

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns if string exist in slice.

func TailDeployment

func TailDeployment(deploymentName string)

TailDeployment is equivalent to "tail -f" for all deployment output

func UpdateState

func UpdateState()

UpdateState checks all changes and update the state file

Types

type DeploymentData

type DeploymentData struct {
	Type   string   `yaml:"type"`
	Name   string   `yaml:"name"`
	CMD    []string `yaml:"cmd"`
	PID    int
	Status string
	CPU    struct {
		Limit int `yaml:"limit"`
	}
	Linux struct {
		User string `yaml:"user"`
	}
}

DeploymentData configs from YAML file

func GetDeploymentByFilePath

func GetDeploymentByFilePath(filePath string) DeploymentData

GetDeploymentByFilePath and returns the DeploymentData populated.

func GetDeploymentByName

func GetDeploymentByName(deploymentName string) DeploymentData

GetDeploymentByName search the deployment by name and returns a DeploymentData populated.

func GetDeployments

func GetDeployments() []DeploymentData

GetDeployments return an array of DeploymentData

Jump to

Keyboard shortcuts

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