2023-11-30 03:02:38 +01:00
|
|
|
package automerge
|
2023-10-05 18:48:54 +02:00
|
|
|
|
2023-11-25 04:15:58 +01:00
|
|
|
// Route: Represents a CRDT of the given route
|
|
|
|
type Route struct {
|
2023-11-27 19:55:41 +01:00
|
|
|
Destination string `automerge:"destination"`
|
|
|
|
Path []string `automerge:"path"`
|
2023-11-25 04:15:58 +01:00
|
|
|
}
|
|
|
|
|
2023-10-25 19:34:38 +02:00
|
|
|
// MeshNodeCrdt: Represents a CRDT for a mesh nodes
|
2023-10-05 18:48:54 +02:00
|
|
|
type MeshNodeCrdt struct {
|
2023-11-25 04:15:58 +01:00
|
|
|
HostEndpoint string `automerge:"hostEndpoint"`
|
|
|
|
WgEndpoint string `automerge:"wgEndpoint"`
|
|
|
|
PublicKey string `automerge:"publicKey"`
|
|
|
|
WgHost string `automerge:"wgHost"`
|
|
|
|
Timestamp int64 `automerge:"timestamp"`
|
|
|
|
Routes map[string]Route `automerge:"routes"`
|
|
|
|
Alias string `automerge:"alias"`
|
|
|
|
Description string `automerge:"description"`
|
|
|
|
Services map[string]string `automerge:"services"`
|
|
|
|
Type string `automerge:"type"`
|
2023-10-05 18:48:54 +02:00
|
|
|
}
|
|
|
|
|
2023-10-25 19:34:38 +02:00
|
|
|
// MeshCrdt: Represents the mesh network as a whole
|
2023-10-05 18:48:54 +02:00
|
|
|
type MeshCrdt struct {
|
|
|
|
Nodes map[string]MeshNodeCrdt `automerge:"nodes"`
|
|
|
|
}
|