servers

package
v3.0.0-alpha.4 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: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEnvironment

func CreateEnvironment(environmentType, folder, id string, environmentSection pufferpanel.MetadataType) (pufferpanel.Environment, error)

func CreateFunctions

func CreateFunctions(env pufferpanel.Environment) []cel.EnvOption

func Delete

func Delete(id string) (err error)

func GetSupportedEnvironments

func GetSupportedEnvironments() []string

func InitService

func InitService()

func LoadFromFolder

func LoadFromFolder()

func Reload

func Reload(id string) (err error)

func Save

func Save(id string) (err error)

func SendStatsForServers

func SendStatsForServers()

func ShutdownService

func ShutdownService()

func StartViaService

func StartViaService(p *Server)

Types

type FileData

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

type OperationProcess

type OperationProcess []*OperationTask

func GenerateProcess

func GenerateProcess(directions []pufferpanel.ConditionalMetadataType, environment pufferpanel.Environment, dataMapping map[string]interface{}, env map[string]string) (OperationProcess, error)

func (*OperationProcess) Run

func (p *OperationProcess) Run(server *Server) error

type OperationTask

type OperationTask struct {
	Operation pufferpanel.CreateOperation
	Condition interface{}
	Type      string
}

type Scheduler

type Scheduler struct {
	Tasks           map[string]pufferpanel.Task `json:"tasks"`
	Timezone        string                      `json:"timezone,omitempty"`
	ConcurrentLimit int                         `json:"concurrentLimit"`
	LimitMode       string                      `json:"limitMode"`
	// contains filtered or unexported fields
}

func LoadScheduler

func LoadScheduler(serverId string) (*Scheduler, error)

LoadScheduler Loads the scheduler from the serverid.cron file, or defaults This file is a JSON file, but it hooks into everything

func NewDefaultScheduler

func NewDefaultScheduler(serverId string) *Scheduler

func (*Scheduler) AddTask

func (s *Scheduler) AddTask(id string, task pufferpanel.Task) error

func (*Scheduler) GetTasks

func (s *Scheduler) GetTasks() map[string]pufferpanel.Task

func (*Scheduler) Init

func (s *Scheduler) Init() error

func (*Scheduler) IsRunning

func (s *Scheduler) IsRunning() bool

func (*Scheduler) IsTaskRunning

func (s *Scheduler) IsTaskRunning(id string) bool

func (*Scheduler) RemoveTask

func (s *Scheduler) RemoveTask(id string) error

func (*Scheduler) RunTask

func (s *Scheduler) RunTask(id string) error

func (*Scheduler) Save

func (s *Scheduler) Save() error

func (*Scheduler) Start

func (s *Scheduler) Start()

func (*Scheduler) Stop

func (s *Scheduler) Stop()

type Server

type Server struct {
	pufferpanel.Server

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

func Create

func Create(program *Server) (server *Server, err error)

func CreateProgram

func CreateProgram() *Server

func GetAll

func GetAll() []*Server

func GetFromCache

func GetFromCache(id string) *Server

func Load

func Load(id string) (program *Server, err error)

func LoadFromData

func LoadFromData(id string, source []byte) (*Server, error)

func (*Server) ArchiveItems

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

func (*Server) Create

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

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

func (*Server) DataToMap

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

func (*Server) Destroy

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

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

func (*Server) EditData

func (p *Server) EditData(data map[string]interface{}) (err error)

func (*Server) Execute

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

func (*Server) Extract

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

func (*Server) GetData

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

func (*Server) GetEnvironment

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

func (*Server) GetFileServer

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

func (*Server) GetItem

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

func (*Server) GetNetwork

func (p *Server) GetNetwork() string

func (*Server) Id

func (p *Server) Id() string

func (*Server) Install

func (p *Server) Install() error

func (*Server) IsAutoStart

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

func (*Server) IsRunning

func (p *Server) IsRunning() (bool, error)

func (*Server) Kill

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

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

func (*Server) Log

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

func (*Server) RunCondition

func (p *Server) RunCondition(condition interface{}, extraData map[string]interface{}) (bool, error)

func (*Server) Save

func (p *Server) Save() (err error)

func (*Server) SetAutoStart

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

func (*Server) SetEnvironment

func (p *Server) SetEnvironment(environment pufferpanel.Environment) (err error)

func (*Server) Start

func (p *Server) Start() error

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

func (*Server) Stop

func (p *Server) Stop() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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