programs

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerFolder   string
	TemplateFolder string
)

Functions

func Create

func Create(id string, serverType string, data map[string]interface{}) bool

func Delete

func Delete(id string) (err error)

func GetPlugin added in v1.1.2

func GetPlugin(name string) (interface{}, error)

func GetPlugins

func GetPlugins() map[string]interface{}

func Initialize

func Initialize()

func LoadFromFolder

func LoadFromFolder()

func Reload

func Reload(id string) error

func Save

func Save(id string) (err error)

Types

type Program

type Program interface {
	//Starts the program.
	//This includes starting the environment if it is not running.
	Start() (err error)

	//Stops the program.
	//This will also stop the environment it is ran in.
	Stop() (err error)

	//Kills the program.
	//This will also stop the environment it is ran in.
	Kill() (err error)

	//Creates any files needed for the program.
	//This includes creating the environment.
	Create() (err error)

	//Destroys the server.
	//This will delete the server, environment, and any files related to it.
	Destroy() (err error)

	Update() (err error)

	Install() (err error)

	//Determines if the server is running.
	IsRunning() (isRunning bool)

	//Sends a command to the process
	//If the program supports input, this will send the arguments to that.
	Execute(command string) (err error)

	SetEnabled(isEnabled bool) (err error)

	IsEnabled() (isEnabled bool)

	SetAutoStart(isAutoStart bool) (err error)

	IsAutoStart() (isAutoStart bool)

	SetEnvironment(environment environments.Environment) (err error)

	Id() string

	GetEnvironment() environments.Environment

	Save(file string) (err error)

	Edit(data map[string]interface{}) (err error)

	Reload(data Program)

	GetData() map[string]interface{}

	GetNetwork() string
}

func Get

func Get(id string) (program Program, err error)

func GetAll

func GetAll() []Program

func GetFromCache

func GetFromCache(id string) Program

func Load

func Load(id string) (program Program, err error)

func LoadFromData

func LoadFromData(id string, source []byte) (program Program, err error)

func LoadFromMapping

func LoadFromMapping(id string, source map[string]interface{}) (program Program, err error)

type Runtime

type Runtime struct {
	Stop      string   `json:"stop"`
	Pre       []string `json:"pre,omitempty"`
	Post      []string `json:"post,omitempty"`
	Program   string   `json:"program"`
	Arguments []string `json:"arguments"`
	Enabled   bool     `json:"enabled"`
	AutoStart bool     `json:"autostart"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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