programs

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(program *Program) error

func Delete

func Delete(id string) (err error)

func ExecuteTask added in v2.3.2

func ExecuteTask(programId string, taskId string) 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 {
	pufferpanel.Server

	CrashCounter       int                     `json:"-"`
	RunningEnvironment pufferpanel.Environment `json:"-"`
	Scheduler          Scheduler               `json:"-"`
	// contains filtered or unexported fields
}

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) ArchiveItems added in v2.3.0

func (p *Program) ArchiveItems(files []string, destination string) error

func (*Program) Create

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

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

func (*Program) DataToMap

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

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) EditData added in v2.3.2

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

func (*Program) Execute

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

func (*Program) ExecuteTask added in v2.5.0

func (p *Program) ExecuteTask(task pufferpanel.Task) (err error)

func (*Program) Extract added in v2.3.0

func (p *Program) Extract(source, destination string) error

func (*Program) GetData

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

func (*Program) GetEnvironment

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

func (*Program) GetFileServer added in v2.7.0

func (p *Program) GetFileServer() pufferpanel.FileServer

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)

func (*Program) Kill

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

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

func (*Program) Log added in v2.6.0

func (p *Program) Log(l *log.Logger, format string, obj ...interface{})

func (*Program) Save

func (p *Program) Save() (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 pufferpanel.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.

type Scheduler added in v2.5.0

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

func NewScheduler added in v2.5.0

func NewScheduler(program *Program) Scheduler

NewScheduler Create a new Scheduler

func (Scheduler) Add added in v2.5.0

func (s Scheduler) Add(task pufferpanel.Task) error

Add a single task

func (Scheduler) Load added in v2.5.0

func (s Scheduler) Load(tasks []pufferpanel.Task) error

Load a slice of tasks

func (Scheduler) LoadMap added in v2.5.0

func (s Scheduler) LoadMap(tasks map[string]pufferpanel.Task) error

LoadMap a map of tasks

func (Scheduler) Rebuild added in v2.5.0

func (s Scheduler) Rebuild() error

Rebuild will stop the scheduler, destroy it and create a new instance

func (Scheduler) Remove added in v2.5.0

func (s Scheduler) Remove(name string) error

Remove a task from the scheduler

func (Scheduler) Start added in v2.5.0

func (s Scheduler) Start() error

Start the Scheduler (safely)

func (Scheduler) Stop added in v2.5.0

func (s Scheduler) Stop() error

Stop the Scheduler if it is running (safely)

Jump to

Keyboard shortcuts

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