remove hyphen
This commit is contained in:
parent
1011cf5e66
commit
dc703e20dc
4
const.go
4
const.go
@ -2,11 +2,11 @@ package dsnet
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// could be overridden in future via env
|
// could be overridden in future via env
|
||||||
CONFIG_FILE = "/etc/dsnet-config.json"
|
CONFIG_FILE = "/etc/dsnetconfig.json"
|
||||||
|
|
||||||
// these end up in the config file
|
// these end up in the config file
|
||||||
DEFAULT_INTERFACE_NAME = "dsnet"
|
DEFAULT_INTERFACE_NAME = "dsnet"
|
||||||
DEFAULT_REPORT_FILE = "/var/lib/dsnet-report.json"
|
DEFAULT_REPORT_FILE = "/var/lib/dsnetreport.json"
|
||||||
DEFAULT_LISTEN_PORT = 51820
|
DEFAULT_LISTEN_PORT = 51820
|
||||||
|
|
||||||
// keepalive always configured for everything
|
// keepalive always configured for everything
|
||||||
|
@ -5,6 +5,35 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Status int
|
||||||
|
|
||||||
|
const (
|
||||||
|
Pending = iota
|
||||||
|
Offline
|
||||||
|
Online
|
||||||
|
Expired
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s Status) String() string {
|
||||||
|
switch s {
|
||||||
|
case Pending:
|
||||||
|
return "pending"
|
||||||
|
case Offline:
|
||||||
|
return "offline"
|
||||||
|
case Online:
|
||||||
|
return "online"
|
||||||
|
case Expired:
|
||||||
|
return "expired"
|
||||||
|
default:
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// note unmarshal not required
|
||||||
|
func (s Status) MarshalJSON() ([]byte, error) {
|
||||||
|
return []byte("\"" + s.String() + "\""), nil
|
||||||
|
}
|
||||||
|
|
||||||
type DsnetReport struct {
|
type DsnetReport struct {
|
||||||
// domain to append to hostnames. Relies on separate DNS server for
|
// domain to append to hostnames. Relies on separate DNS server for
|
||||||
// resolution. Informational only.
|
// resolution. Informational only.
|
||||||
|
Loading…
Reference in New Issue
Block a user