Add core packages, configuration system, and initial application structure
This commit is contained in:
23
app/main.go
Normal file
23
app/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lol.mleku.dev/log"
|
||||
"next.orly.dev/app/config"
|
||||
)
|
||||
|
||||
func Run(ctx context.Context, cfg *config.C) (quit chan struct{}) {
|
||||
// shutdown handler
|
||||
go func() {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
log.I.F("shutting down")
|
||||
close(quit)
|
||||
}
|
||||
}()
|
||||
// start listener
|
||||
|
||||
quit = make(chan struct{})
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user