Documentation
¶
Index ¶
- Variables
- func ValidRestartPolicy(policy RestartPolicy) bool
- func ValidateServerName(name string) error
- type BridgeConfig
- type BridgeStatus
- type Player
- type RestartPolicy
- type Server
- func (s *Server) Broadcast(text string) error
- func (s *Server) Players(ctx context.Context) ([]Player, error)
- func (s *Server) Restart(ctx context.Context) (ServerInfo, error)
- func (s *Server) Run(ctx context.Context)
- func (s *Server) RunCommand(command string) error
- func (s *Server) RunCommandResponse(ctx context.Context, command string) (string, error)
- func (s *Server) Start(ctx context.Context) (ServerInfo, error)
- func (s *Server) Status(ctx context.Context) (ServerInfo, error)
- func (s *Server) Stop(ctx context.Context) (ServerInfo, error)
- type ServerConfig
- type ServerInfo
- type ServerState
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBridgeNotConnected = errors.New("bridge not connected")
Functions ¶
func ValidRestartPolicy ¶
func ValidRestartPolicy(policy RestartPolicy) bool
func ValidateServerName ¶
Types ¶
type BridgeConfig ¶
type BridgeStatus ¶
type RestartPolicy ¶
type RestartPolicy string
const ( RestartNever RestartPolicy = "never" RestartOnFailure RestartPolicy = "on-failure" RestartAlways RestartPolicy = "always" )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RunCommand ¶
func (*Server) RunCommandResponse ¶
type ServerConfig ¶
type ServerConfig struct {
Name string
Root string
StartCommand []string
RestartPolicy RestartPolicy
Bridge *BridgeConfig
}
type ServerInfo ¶
type ServerInfo struct {
Name string `json:"name"`
Root string `json:"root"`
StartCommand []string `json:"start_command,omitempty"`
RestartPolicy RestartPolicy `json:"restart_policy"`
State ServerState `json:"state"`
Pid int `json:"pid,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
UptimeSeconds int64 `json:"uptime_seconds,omitempty"`
Bridge *BridgeStatus `json:"bridge,omitempty"`
}
type ServerState ¶
type ServerState string
const ( StateStopped ServerState = "stopped" StateStarting ServerState = "starting" StateRunning ServerState = "running" StateStopping ServerState = "stopping" StateExited ServerState = "exited" )
Click to show internal directories.
Click to hide internal directories.