programs

package
v2.0.0-...-6548848 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerFolder string
)

Functions

func Create

func Create(program *Program) error

func Delete

func Delete(id string) (err error)

func InitService

func InitService()

func Initialize

func Initialize()

func LoadFromFolder

func LoadFromFolder()

func Reload

func Reload(id string) (err error)

func Save

func Save(id string) (err error)

func ShutdownService

func ShutdownService()

func StartViaService

func StartViaService(p *Program)

Types

type FileData

type FileData struct {
	Contents      io.ReadCloser
	ContentLength int64
	FileList      []messages.FileDesc
	Name          string
}

type Program

type Program struct {
	apufferi.Server

	CrashCounter int
	Environment  envs.Environment
}

func CreateProgram

func CreateProgram() *Program

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, error)

func (*Program) CopyFrom

func (p *Program) CopyFrom(s *Program)

func (*Program) Create

func (p *Program) Create() (err error)

Creates any files needed for the program. This includes creating the environment.

func (*Program) CreateFolder

func (p *Program) CreateFolder(name string) error

func (*Program) DataToMap

func (p *Program) DataToMap() map[string]interface{}

func (*Program) DeleteItem

func (p *Program) DeleteItem(name string) error

func (*Program) Destroy

func (p *Program) Destroy() (err error)

Destroys the server. This will delete the server, environment, and any files related to it.

func (*Program) Edit

func (p *Program) Edit(data map[string]apufferi.Variable, overrideUser bool) (err error)

func (*Program) Execute

func (p *Program) Execute(command string) (err error)

Sends a command to the process If the program supports input, this will send the arguments to that.

func (*Program) GetData

func (p *Program) GetData() map[string]apufferi.Variable

func (*Program) GetEnvironment

func (p *Program) GetEnvironment() envs.Environment

func (*Program) GetItem

func (p *Program) GetItem(name string) (*FileData, error)

func (*Program) GetNetwork

func (p *Program) GetNetwork() string

func (*Program) Id

func (p *Program) Id() string

func (*Program) Install

func (p *Program) Install() (err error)

func (*Program) IsAutoStart

func (p *Program) IsAutoStart() (isAutoStart bool)

func (*Program) IsEnabled

func (p *Program) IsEnabled() (isEnabled bool)

func (*Program) IsRunning

func (p *Program) IsRunning() (isRunning bool, err error)

Determines if the server is running.

func (*Program) Kill

func (p *Program) Kill() (err error)

Kills the program. This will also stop the environment it is ran in.

func (*Program) OpenFile

func (p *Program) OpenFile(name string) (io.WriteCloser, error)

func (*Program) Save

func (p *Program) Save(file string) (err error)

func (*Program) SetAutoStart

func (p *Program) SetAutoStart(isAutoStart bool) (err error)

func (*Program) SetEnabled

func (p *Program) SetEnabled(isEnabled bool) (err error)

func (*Program) SetEnvironment

func (p *Program) SetEnvironment(environment envs.Environment) (err error)

func (*Program) Start

func (p *Program) Start() (err error)

Starts the program. This includes starting the environment if it is not running.

func (*Program) Stop

func (p *Program) Stop() (err error)

Stops the program. This will also stop the environment it is ran in.

Jump to

Keyboard shortcuts

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