Versions in this module Expand all Collapse all v1 v1.0.1 May 27, 2025 Changes in this version + const ActivityConsoleCommand + const ActivityFileUploaded + const ActivityPowerPrefix + const ActivitySftpCreate + const ActivitySftpCreateDirectory + const ActivitySftpDelete + const ActivitySftpRename + const ActivitySftpWrite + const BackupCompletedEvent + const BackupRestoreCompletedEvent + const ConsoleOutputEvent + const DaemonMessageEvent + const DeletedEvent + const InstallCompletedEvent + const InstallOutputEvent + const InstallStartedEvent + const PowerActionRestart + const PowerActionStart + const PowerActionStop + const PowerActionTerminate + const StatsEvent + const StatusEvent + const TransferLogsEvent + const TransferStatusEvent + var ErrIsRunning = errors.New("server is running") + var ErrServerIsInstalling = errors.New("server is currently installing") + var ErrServerIsRestoring = errors.New("server is currently being restored") + var ErrServerIsTransferring = errors.New("server is currently being transferred") + var ErrSuspended = errors.New("server is currently in a suspended state") + func IsServerDoesNotExistError(err error) bool + func IsTooFrequentCrashError(err error) bool + type APIResponse struct + Configuration Configuration + IsSuspended bool + State string + Utilization ResourceUsage + type Configuration struct + Allocations environment.Allocations + Build environment.Limits + Container struct{ ... } + CrashDetectionEnabled bool + Egg EggConfiguration + EnvVars environment.Variables + Invocation string + Labels map[string]string + Meta ConfigurationMeta + Mounts []Mount + SkipEggScripts bool + Suspended bool + Uuid string + func (c *Configuration) GetUuid() string + func (c *Configuration) SetSuspended(s bool) + type ConfigurationMeta struct + Description string + Name string + type ConsoleThrottle struct + func (ct *ConsoleThrottle) Allow() bool + func (ct *ConsoleThrottle) Reset() + type CrashHandler struct + func (cd *CrashHandler) LastCrashTime() time.Time + func (cd *CrashHandler) SetLastCrash(t time.Time) + type EggConfiguration struct + FileDenylist []string + ID string + type InstallationProcess struct + Script *remote.InstallationScript + Server *Server + func NewInstallationProcess(s *Server, script *remote.InstallationScript) (*InstallationProcess, error) + func (ip *InstallationProcess) AfterExecute(containerId string) error + func (ip *InstallationProcess) BeforeExecute() error + func (ip *InstallationProcess) Execute() (string, error) + func (ip *InstallationProcess) GetLogPath() string + func (ip *InstallationProcess) RemoveContainer() error + func (ip *InstallationProcess) Run() error + func (ip *InstallationProcess) StreamOutput(ctx context.Context, id string) error + type Manager struct + func NewEmptyManager(client remote.Client) *Manager + func NewManager(ctx context.Context, client remote.Client) (*Manager, error) + func (m *Manager) Add(s *Server) + func (m *Manager) All() []*Server + func (m *Manager) Client() remote.Client + func (m *Manager) Filter(filter func(match *Server) bool) []*Server + func (m *Manager) Find(filter func(match *Server) bool) *Server + func (m *Manager) Get(uuid string) (*Server, bool) + func (m *Manager) InitServer(data remote.ServerConfigurationResponse) (*Server, error) + func (m *Manager) Keys() []string + func (m *Manager) Len() int + func (m *Manager) PersistStates() error + func (m *Manager) Put(s []*Server) + func (m *Manager) ReadStates() (map[string]string, error) + func (m *Manager) Remove(filter func(match *Server) bool) + type Mount environment.Mount + type PowerAction string + func (pa PowerAction) IsStart() bool + func (pa PowerAction) IsValid() bool + type RequestActivity struct + func (ra RequestActivity) Event(event models.Event, metadata models.ActivityMeta) *models.Activity + func (ra RequestActivity) SetUser(u string) RequestActivity + type ResourceUsage struct + Disk int64 + State *system.AtomicString + func (ru *ResourceUsage) Reset() + func (ru *ResourceUsage) UpdateStats(stats environment.Stats) + type Server struct + Environment environment.ProcessEnvironment + func New(client remote.Client) (*Server, error) + func (s *Server) Backup(b backup.BackupInterface) error + func (s *Server) CleanupForDestroy() + func (s *Server) Config() *Configuration + func (s *Server) Context() context.Context + func (s *Server) CreateEnvironment() error + func (s *Server) CtxCancel() + func (s *Server) DestroyAllSinks() + func (s *Server) DiskSpace() int64 + func (s *Server) EnsureDataDirectoryExists() error + func (s *Server) Events() *events.Bus + func (s *Server) ExecutingPowerAction() bool + func (s *Server) Filesystem() *filesystem.Filesystem + func (s *Server) GetEnvironmentVariables() []string + func (s *Server) HandlePowerAction(action PowerAction, waitSeconds ...int) error + func (s *Server) ID() string + func (s *Server) Id() string + func (s *Server) Install() error + func (s *Server) IsInstalling() bool + func (s *Server) IsRestoring() bool + func (s *Server) IsRunning() bool + func (s *Server) IsSuspended() bool + func (s *Server) IsTransferring() bool + func (s *Server) Log() *log.Entry + func (s *Server) MemoryLimit() int64 + func (s *Server) Mounts() []environment.Mount + func (s *Server) NewRequestActivity(user string, ip string) RequestActivity + func (s *Server) OnStateChange() + func (s *Server) Proc() ResourceUsage + func (s *Server) ProcessConfiguration() *remote.ProcessConfiguration + func (s *Server) PublishConsoleOutputFromDaemon(data string) + func (s *Server) ReadLogfile(len int) ([]string, error) + func (s *Server) Reinstall() error + func (s *Server) RestoreBackup(b backup.BackupInterface, reader io.ReadCloser) (err error) + func (s *Server) SaveActivity(a RequestActivity, event models.Event, metadata models.ActivityMeta) + func (s *Server) SetRestoring(state bool) + func (s *Server) SetTransferring(state bool) + func (s *Server) Sink(name system.SinkName) *system.SinkPool + func (s *Server) StartEventListeners() + func (s *Server) Sync() error + func (s *Server) SyncInstallState(successful, reinstall bool) error + func (s *Server) SyncWithConfiguration(cfg remote.ServerConfigurationResponse) error + func (s *Server) SyncWithEnvironment() + func (s *Server) Throttler() *ConsoleThrottle + func (s *Server) ToAPIResponse() APIResponse + func (s *Server) UpdateConfigurationFiles() + func (s *Server) Websockets() *WebsocketBag + type WebsocketBag struct + func (w *WebsocketBag) CancelAll() + func (w *WebsocketBag) Push(u uuid.UUID, cancel *context.CancelFunc) + func (w *WebsocketBag) Remove(u uuid.UUID)