"syscall"
"time"
+ "github.com/davecgh/go-spew/spew"
"golang.org/x/net/netutil"
"go.stargrave.org/godlighty"
}
}
+ info := make(chan os.Signal)
+ signal.Notify(info, syscall.SIGINFO)
+ go func() {
+ for {
+ <-info
+ spew.Fdump(os.Stdout, godlighty.Hosts)
+ }
+ }()
+
srv := http.Server{Handler: godlighty.MainHandler}
go func() {
<-shutdown
@end itemize
-Basically all configuration is done directly inside source code.
+Basically all configuration is done directly inside source code. You
+have to recompile it every time configuration changes. Is it a problem?
+I doubt, because Go is very fast. But it produces huge statically linked
+executables, you say! Use @command{bsdiff}/@command{bspatch}!
+
+Send @code{SIGINFO} signal to get current daemon's configuration.
+
Initially @command{godlighty} has basic static files handlers (with
compression, HTTP preconditions are enabled of course). In the example
below there are nearly all default functions.
go 1.17
require (
+ github.com/davecgh/go-spew v1.1.1
github.com/dustin/go-humanize v1.0.0
github.com/klauspost/compress v1.13.6
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=