22 lines
520 B
Go
22 lines
520 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type NodeState string
|
|
|
|
const (
|
|
NodeStatePending NodeState = "pending"
|
|
NodeStateReady NodeState = "ready"
|
|
NodeStateLeft NodeState = "left"
|
|
)
|
|
|
|
type Node struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
State NodeState `json:"state"`
|
|
JoinedAt time.Time `json:"joined_at"`
|
|
LastSeen time.Time `json:"last_seen"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
}
|