two/internal/dispatcher/subnet_commands.go
GnomeZworc 064b90f5e4
f-21: refactor: add dispatcher layer for MQTT migration
Introduce internal/dispatcher package with a Command interface and typed
commands (CreateVPC, DeleteVPC, CreateSubnet, DeleteSubnet). The API
handlers now call dispatcher.Dispatch() instead of enqueuing closures
directly, decoupling transport (HTTP today, MQTT tomorrow) from execution.

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-04-19 00:11:59 +02:00

26 lines
492 B
Go

package dispatcher
import "github.com/dgraph-io/badger/v4"
type CreateSubnetCommand struct {
Name string
VPC string
VxlanID int
LocalIP string
GatewayIP string
CIDR string
}
func (c CreateSubnetCommand) Execute(db *badger.DB) error {
// TODO: brancher internal/subnet/create.go
return nil
}
type DeleteSubnetCommand struct {
Name string
}
func (c DeleteSubnetCommand) Execute(db *badger.DB) error {
// TODO: brancher internal/subnet/delete.go
return nil
}