Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶ added in v0.6.0
type Server struct {
Router *gin.Engine
Config *config.Config
// Queue driver and client of background jobs.
QueueDriver string
Queue queue.Client
DB *gorm.DB
}
Server is an initialized GoHead.
func InitializeServer ¶
func InitializeServer(cfgPath string, opts ServerOptions) (*Server, func(), error)
InitializeServer builds the router and its dependencies. The returned cleanup function releases long-lived resources (queue client, tracer) and must be called when the server stops.
type ServerOptions ¶ added in v0.6.0
type ServerOptions struct {
// Standalone runs the worker, dispatcher and scheduler in the API
// process, with the database job queue unless configured otherwise.
Standalone bool
// DataDir holds the SQLite database, the uploads and a generated JWT
// secret, unless they are configured otherwise.
DataDir string
}
ServerOptions changes how the server runs.