mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Seperate Definitions by Sub System
This commit is contained in:
parent
14c8da64cc
commit
72bf96295d
31 changed files with 120 additions and 108 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"nfsense.net/nfsense/internal/definitions"
|
||||
"nfsense.net/nfsense/internal/definitions/network"
|
||||
"nfsense.net/nfsense/internal/networkd/dbus"
|
||||
)
|
||||
|
||||
|
@ -28,7 +28,7 @@ type GetInterfaceParameters struct {
|
|||
|
||||
type GetInterfaceResult struct {
|
||||
Name string `json:"name"`
|
||||
definitions.Interface
|
||||
network.Interface
|
||||
}
|
||||
|
||||
func (f *Network) GetInterface(ctx context.Context, params GetInterfaceParameters) (GetInterfaceResult, error) {
|
||||
|
@ -44,7 +44,7 @@ func (f *Network) GetInterface(ctx context.Context, params GetInterfaceParameter
|
|||
}
|
||||
|
||||
type GetInterfacesResult struct {
|
||||
Interfaces map[string]definitions.Interface
|
||||
Interfaces map[string]network.Interface
|
||||
}
|
||||
|
||||
func (f *Network) GetInterfaces(ctx context.Context, params struct{}) (GetInterfacesResult, error) {
|
||||
|
@ -55,7 +55,7 @@ func (f *Network) GetInterfaces(ctx context.Context, params struct{}) (GetInterf
|
|||
|
||||
type CreateInterfaceParameters struct {
|
||||
Name string `json:"name"`
|
||||
definitions.Interface
|
||||
network.Interface
|
||||
}
|
||||
|
||||
func (f *Network) CreateInterface(ctx context.Context, params CreateInterfaceParameters) (struct{}, error) {
|
||||
|
@ -73,7 +73,7 @@ func (f *Network) CreateInterface(ctx context.Context, params CreateInterfacePar
|
|||
|
||||
type UpdateInterfaceParameters struct {
|
||||
Name string
|
||||
definitions.Interface
|
||||
network.Interface
|
||||
}
|
||||
|
||||
func (f *Network) UpdateInterface(ctx context.Context, params UpdateInterfaceParameters) (struct{}, error) {
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"nfsense.net/nfsense/internal/definitions"
|
||||
"nfsense.net/nfsense/internal/definitions/network"
|
||||
)
|
||||
|
||||
type GetStaticRoutesResult struct {
|
||||
StaticRoutes []definitions.StaticRoute
|
||||
StaticRoutes []network.StaticRoute
|
||||
}
|
||||
|
||||
func (f *Network) GetStaticRoutes(ctx context.Context, params struct{}) (GetStaticRoutesResult, error) {
|
||||
|
@ -17,7 +17,7 @@ func (f *Network) GetStaticRoutes(ctx context.Context, params struct{}) (GetStat
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (f *Network) CreateStaticRoute(ctx context.Context, params definitions.StaticRoute) (struct{}, error) {
|
||||
func (f *Network) CreateStaticRoute(ctx context.Context, params network.StaticRoute) (struct{}, error) {
|
||||
t, conf := f.ConfigManager.StartTransaction()
|
||||
defer t.Discard()
|
||||
|
||||
|
@ -27,7 +27,7 @@ func (f *Network) CreateStaticRoute(ctx context.Context, params definitions.Stat
|
|||
|
||||
type UpdateStaticRouteParameters struct {
|
||||
Index uint
|
||||
definitions.StaticRoute
|
||||
network.StaticRoute
|
||||
}
|
||||
|
||||
func (f *Network) UpdateStaticRoute(ctx context.Context, params UpdateStaticRouteParameters) (struct{}, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue