serverutil
v1.1.1
djinn-ci.com/serverutil
Documentation
pkg.go.dev ↗Variables
DefaultGates
var (
DefaultGates = map[string]func(*sqlx.DB) web.Gate{
"build": buildrouter.Gate,
"cron": cronrouter.Gate,
"image": imagerouter.Gate,
"key": keyrouter.Gate,
"namespace": namespacerouter.Gate,
"oauth2": oauth2router.Gate,
"object": objectrouter.Gate,
"provider": providerrouter.Gate,
"variable": variablerouter.Gate,
}
)
Functions
Init
func Init(ctx context.Context, path string) (*server.Server, *config.Server, func(), error)
ParseFlags
func ParseFlags(args []string) (bool, string, bool, bool)
RegisterRoutes
func RegisterRoutes(cfg *config.Server, api, ui bool, srv *server.Server)
RegisterRoutesWithGates
func RegisterRoutesWithGates(cfg *config.Server, api, ui bool, srv *server.Server, gates map[string][]web.Gate)
Start
func Start(srv *server.Server, ch chan os.Signal)
Start will start the server in a goroutine. If the server fails to start then SIGKILL is sent to the given channel to signal that the program should terminate. A channel is used so we can gracefully close down any connections that the server may have opened.