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:
parent
da6295baf1
commit
aa1cc58ae3
20 changed files with 2235 additions and 0 deletions
31
internal/api/hostsvc/models.go
Normal file
31
internal/api/hostsvc/models.go
Normal 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"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue