forked from extern/smegmesh
b179cd3cf4
Hashing the interface and using ephmeral ports so that the admin doesn't choose an interface and port combination. An administrator can alteranatively decide to provide port but this isn't critical.
29 lines
883 B
Go
29 lines
883 B
Go
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"`
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
type JoinMeshRequest struct {
|
|
WgPort int `json:"port" binding:"gte=1024,lt=65535"`
|
|
Bootstrap string `json:"bootstrap" binding:"required"`
|
|
MeshId string `json:"meshid" binding:"required"`
|
|
}
|