Maint: routing interface composition

This commit is contained in:
Quentin McGaw (desktop)
2021-07-26 16:18:53 +00:00
parent 73c383fd65
commit d7a6caa2ac
5 changed files with 57 additions and 11 deletions

View File

@@ -20,6 +20,10 @@ var (
ErrSubnetsOutboundSet = errors.New("cannot set outbound subnets routes")
)
type Setuper interface {
Setup() (err error)
}
func (r *routing) Setup() (err error) {
defaultIP, err := r.DefaultIP()
if err != nil {
@@ -59,6 +63,10 @@ func (r *routing) Setup() (err error) {
return nil
}
type TearDowner interface {
TearDown() error
}
func (r *routing) TearDown() error {
defaultIP, err := r.DefaultIP()
if err != nil {