36 lines
572 B
Go
36 lines
572 B
Go
package spec
|
|
|
|
const NameGateway Name = "gateway.emissary.cadoles.com"
|
|
|
|
type GatewayID string
|
|
|
|
type Gateway struct {
|
|
Revision int
|
|
Gateways map[GatewayID]GatewayEntry
|
|
}
|
|
|
|
type GatewayEntry struct {
|
|
Address string
|
|
Target string
|
|
}
|
|
|
|
func (g *Gateway) SpecName() Name {
|
|
return NameGateway
|
|
}
|
|
|
|
func (g *Gateway) SpecRevision() int {
|
|
return g.Revision
|
|
}
|
|
|
|
func (g *Gateway) SpecData() any {
|
|
return struct {
|
|
Gateways map[GatewayID]GatewayEntry
|
|
}{Gateways: g.Gateways}
|
|
}
|
|
|
|
func NewGatewaySpec() *Gateway {
|
|
return &Gateway{
|
|
Gateways: make(map[GatewayID]GatewayEntry),
|
|
}
|
|
}
|