2023-11-13 11:44:14 +01:00
|
|
|
package api
|
|
|
|
|
2023-11-20 19:07:52 +01:00
|
|
|
type Route struct {
|
|
|
|
RouteId string `json:"routeId"`
|
|
|
|
Prefix string `json:"prefix"`
|
|
|
|
}
|
|
|
|
|
2023-11-13 11:44:14 +01:00
|
|
|
type SmegNode struct {
|
2023-11-17 23:13:51 +01:00
|
|
|
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"`
|
2023-11-20 19:07:52 +01:00
|
|
|
Routes []Route `json:"routes"`
|
2023-11-17 23:13:51 +01:00
|
|
|
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 {
|
2023-11-20 16:22:32 +01:00
|
|
|
WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"`
|
2023-11-13 11:44:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type JoinMeshRequest struct {
|
2023-11-20 16:22:32 +01:00
|
|
|
WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"`
|
2023-11-13 11:44:14 +01:00
|
|
|
Bootstrap string `json:"bootstrap" binding:"required"`
|
|
|
|
MeshId string `json:"meshid" binding:"required"`
|
|
|
|
}
|
2023-11-20 19:07:52 +01:00
|
|
|
|
|
|
|
type ApiServerConf struct {
|
|
|
|
WordsFile string
|
|
|
|
}
|