mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-13 18:11:25 +01:00
d8e156f13f
Added the route path into the route object so that we can see what meshes packets are routed across.
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package api
|
|
|
|
type Route struct {
|
|
Prefix string `json:"prefix"`
|
|
Path []string `json:"path"`
|
|
}
|
|
|
|
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 []Route `json:"routes"`
|
|
Services map[string]string `json:"services"`
|
|
}
|
|
|
|
type SmegMesh struct {
|
|
MeshId string `json:"meshid"`
|
|
Nodes map[string]SmegNode `json:"nodes"`
|
|
}
|
|
|
|
type CreateMeshRequest struct {
|
|
WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"`
|
|
}
|
|
|
|
type JoinMeshRequest struct {
|
|
WgPort int `json:"port" binding:"omitempty,gte=1024,lt=65535"`
|
|
Bootstrap string `json:"bootstrap" binding:"required"`
|
|
MeshId string `json:"meshid" binding:"required"`
|
|
}
|
|
|
|
type ApiServerConf struct {
|
|
WordsFile string
|
|
}
|