Intermediary refactor teasing apart http / ipc

Introduces an IPC struct and moves the logic out of the http handlers
and into methods on that.
This commit is contained in:
Arlo Breault 2021-05-20 07:49:27 -04:00
parent ced539f234
commit 015958fbe6
4 changed files with 449 additions and 319 deletions

18
common/messages/ipc.go Normal file
View file

@ -0,0 +1,18 @@
package messages
import (
"errors"
)
type Arg struct {
Body []byte
RemoteAddr string
NatType string
}
var (
ErrBadRequest = errors.New("bad request")
ErrInternal = errors.New("internal error")
ErrUnavailable = errors.New("service unavailable")
ErrTimeout = errors.New("timeout")
)