1
0
forked from extern/smegmesh
smegmesh/pkg/api/types.go

29 lines
883 B
Go
Raw Normal View History

2023-11-13 11:44:14 +01:00
package api
type SmegNode struct {
Alias string `json:"alias"`
WgHost string `json:"wgHost"`
WgEndpoint string `json:"wgEndpoint"`
Endpoint string `json:"endpoint"`
Timestamp int `json:"timestamp"`
Description string `json:"description"`
PublicKey string `json:"publicKey"`
Routes []string `json:"routes"`
Services map[string]string `json:"services"`
2023-11-13 11:44:14 +01:00
}
type SmegMesh struct {
MeshId string `json:"meshid"`
Nodes map[string]SmegNode `json:"nodes"`
}
type CreateMeshRequest struct {
WgPort int `json:"port" binding:"gte=1024,lt=65535"`
2023-11-13 11:44:14 +01:00
}
type JoinMeshRequest struct {
WgPort int `json:"port" binding:"gte=1024,lt=65535"`
2023-11-13 11:44:14 +01:00
Bootstrap string `json:"bootstrap" binding:"required"`
MeshId string `json:"meshid" binding:"required"`
}