remove hyphen

This commit is contained in:
Callan Bryant 2020-03-03 23:32:07 +00:00
parent 1011cf5e66
commit dc703e20dc
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
2 changed files with 31 additions and 2 deletions

View File

@ -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

View File

@ -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.