Documentation
¶
Index ¶
- Constants
- type PanelRequest
- func (r *PanelRequest) Error() *RequestError
- func (r *PanelRequest) Get(url string) (*http.Response, error)
- func (r *PanelRequest) GetClient() *http.Client
- func (r *PanelRequest) GetEndpoint(endpoint string) string
- func (r *PanelRequest) GetServerConfiguration(uuid string) (*ServerConfigurationResponse, *RequestError, error)
- func (r *PanelRequest) HasError() bool
- func (r *PanelRequest) HttpResponseCode() int
- func (r *PanelRequest) Post(url string, data []byte) (*http.Response, error)
- func (r *PanelRequest) ReadBody() ([]byte, error)
- func (r *PanelRequest) SetHeaders(req *http.Request) *http.Request
- func (r *PanelRequest) ValidateSftpCredentials(request sftp_server.AuthenticationRequest) (*sftp_server.AuthenticationResponse, error)
- type ProcessConfiguration
- type RequestError
- type RequestErrorBag
- type ServerConfigurationResponse
Constants ¶
const ( ProcessStopCommand = "command" ProcessStopSignal = "signal" ProcessStopNativeStop = "stop" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PanelRequest ¶
func (*PanelRequest) Error ¶
func (r *PanelRequest) Error() *RequestError
Returns the error message from the API call as a string. The error message will be formatted similar to the below example:
HttpNotFoundException: The requested resource does not exist. (HTTP/404)
func (*PanelRequest) GetClient ¶
func (r *PanelRequest) GetClient() *http.Client
Builds the base request instance that can be used with the HTTP client.
func (*PanelRequest) GetEndpoint ¶
func (r *PanelRequest) GetEndpoint(endpoint string) string
func (*PanelRequest) GetServerConfiguration ¶
func (r *PanelRequest) GetServerConfiguration(uuid string) (*ServerConfigurationResponse, *RequestError, error)
Fetches the server configuration and returns the struct for it.
func (*PanelRequest) HasError ¶
func (r *PanelRequest) HasError() bool
Determines if the API call encountered an error. If no request has been made the response will be false.
func (*PanelRequest) HttpResponseCode ¶
func (r *PanelRequest) HttpResponseCode() int
func (*PanelRequest) ReadBody ¶
func (r *PanelRequest) ReadBody() ([]byte, error)
Reads the body from the response and returns it, then replaces it on the response so that it can be read again later.
func (*PanelRequest) SetHeaders ¶
func (r *PanelRequest) SetHeaders(req *http.Request) *http.Request
func (*PanelRequest) ValidateSftpCredentials ¶
func (r *PanelRequest) ValidateSftpCredentials(request sftp_server.AuthenticationRequest) (*sftp_server.AuthenticationResponse, error)
type ProcessConfiguration ¶
type ProcessConfiguration struct {
Startup struct {
Done string `json:"done"`
UserInteraction []string `json:"userInteraction"`
} `json:"startup"`
Stop struct {
Type string `json:"type"`
Value string `json:"value"`
} `json:"stop"`
ConfigurationFiles []parser.ConfigurationFile `json:"configs"`
}
Defines the process configuration for a given server instance. This sets what the daemon is looking for to mark a server as done starting, what to do when stopping, and what changes to make to the configuration file for a server.
type RequestError ¶
type RequestError struct {
Code string `json:"code"`
Status string `json:"status"`
Detail string `json:"detail"`
}
func (*RequestError) String ¶
func (re *RequestError) String() string
Returns the error response in a string form that can be more easily consumed.
type RequestErrorBag ¶
type RequestErrorBag struct {
Errors []RequestError `json:"errors"`
}
type ServerConfigurationResponse ¶
type ServerConfigurationResponse struct {
Settings json.RawMessage `json:"settings"`
ProcessConfiguration *ProcessConfiguration `json:"process_configuration"`
}
Holds the server configuration data returned from the Panel. When a server process is started, Wings communicates with the Panel to fetch the latest build information as well as get all of the details needed to parse the given Egg.
This means we do not need to hit Wings each time part of the server is updated, and the Panel serves as the source of truth at all times. This also means if a configuration is accidentally wiped on Wings we can self-recover without too much hassle, so long as Wings is aware of what servers should exist on it.