f-86: hostsvc: relais DNS et NTP par hôte, socket de contrôle #86

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-25 20:32:06 +01:00
commit aa1cc58ae3
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
20 changed files with 2235 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package hostsvcapi
import "path/filepath"
type Verb string
const (
VerbOpen Verb = "open"
VerbClose Verb = "close"
VerbList Verb = "list"
)
const (
MaxMessageBytes = 64 * 1024
DefaultRunDir = "/run/two/hostsvc"
Unit = "two-hostsvc.service"
)
func SocketPath(runDir string) string { return filepath.Join(runDir, "hostsvc.sock") }
func StatePath(runDir string) string { return filepath.Join(runDir, "hostsvc.state") }
type Request struct {
Verb Verb `json:"verb"`
VPC string `json:"vpc,omitempty"`
}
type Response struct {
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
VPCs []string `json:"vpcs,omitempty"`
}