Maint: firewall package interface rework
- return concrete struct type - split interface is sub-interfaces
This commit is contained in:
@@ -6,7 +6,12 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func (c *configurator) SetAllowedPort(ctx context.Context, port uint16, intf string) (err error) {
|
||||
type PortAllower interface {
|
||||
SetAllowedPort(ctx context.Context, port uint16, intf string) (err error)
|
||||
RemoveAllowedPort(ctx context.Context, port uint16) (err error)
|
||||
}
|
||||
|
||||
func (c *Config) SetAllowedPort(ctx context.Context, port uint16, intf string) (err error) {
|
||||
c.stateMutex.Lock()
|
||||
defer c.stateMutex.Unlock()
|
||||
|
||||
@@ -41,7 +46,7 @@ func (c *configurator) SetAllowedPort(ctx context.Context, port uint16, intf str
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *configurator) RemoveAllowedPort(ctx context.Context, port uint16) (err error) {
|
||||
func (c *Config) RemoveAllowedPort(ctx context.Context, port uint16) (err error) {
|
||||
c.stateMutex.Lock()
|
||||
defer c.stateMutex.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user