Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TerminationSignalWatcher ¶
TerminationSignalWatcher will wait for interrupt signal to gracefully shutdown the server with a timeout of x seconds.
Types ¶
type ApplicationConfig ¶
type ApplicationConfig struct { ApplicationMode string DatabaseConnection string WebAssetLocation string }
ApplicationConfig represents the necessary configuration for the application.
func GetConfig ¶
func GetConfig() *ApplicationConfig
GetConfig will return a populated ApplicationConfig object from variables in the OS environment.
type ApplicationServer ¶
type ApplicationServer struct {
State ApplicationState
}
ApplicationServer is the core application's handler, the contact surface with outside world.
func NewApplicationServer ¶
func NewApplicationServer(userOptions *ApplicationState) *ApplicationServer
NewApplicationServer will return a fully configured ApplicationServer.
type ApplicationServerResponse ¶
type ApplicationServerResponse struct { Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` UnixTimestamp int64 `json:"unix_timestamp"` }
ApplicationServerResponse is the standard response the server returns when using JSON.
type ApplicationState ¶
type ApplicationState struct { Handler infrastructure.ApplicationHTTPHandler HTTPServer *http.Server DB infrastructure.ApplicationDatabase Config *ApplicationConfig }
ApplicationState is the application's state in a centralized manner.
Click to show internal directories.
Click to hide internal directories.