courgette/internal/daemon/api.go

24 lines
428 B
Go

package daemon
import (
httpKit "forge.karnov.club/marc/http-api-kit"
)
// Representation of the daemon process that services the runner's
// Rest API.
type Daemon struct {
Addr string
Api *httpKit.App
}
func NewDaemon() *Daemon {
api := httpKit.NewApp()
return &Daemon{Api: api}
}
// Starts listening for requests at the given address for
// daemon traffic.
func (d Daemon) Start(addr string) {
d.Api.Start(addr)
}