type Node struct {
ID string
Name string
Type NodeType
Address string
Services []ServiceInfo
Health *HealthInfo
PeerManager *PeerManager
MeshServer *MeshServer
Topology *Topology
TLSConfig *TLSConfig
}
Field
Type
Description
ID
string
Unique identifier, used in certificates
Name
string
Human-readable label
Type
NodeType
Classification (e.g., gateway, worker)
Address
string
Host:port for connections
Services
[]ServiceInfo
Services this node provides
Health
*HealthInfo
Current health status
PeerManager
*PeerManager
Manages outgoing connections
MeshServer
*MeshServer
gRPC server for incoming connections
Topology
*Topology
View of mesh membership
TLSConfig
*TLSConfig
Certificates and TLS settings
NodeType
type NodeType string
const (
NodeTypeGeneric NodeType = "generic"
)
Node classification. Applications can define custom types.
NodeInfo
type NodeInfo struct {
ID string
Name string
Type NodeType
Address string
Services []ServiceInfo
JoinedAt time.Time
UpdatedAt time.Time
}
Field
Type
Description
ID
string
Node identifier
Name
string
Node name
Type
NodeType
Node type
Address
string
Node address
Services
[]ServiceInfo
Services the node provides
JoinedAt
time.Time
When node joined topology
UpdatedAt
time.Time
Last update timestamp
ServiceInfo
type ServiceInfo struct {
Name string
Version string
}
Field
Type
Description
Name
string
Service name (e.g., "identity")
Version
string
Service version (e.g., "v1")
PeerInfo
type PeerInfo struct {
ID string
Type NodeType
Address string
}
Field
Type
Description
ID
string
Peer node ID
Type
NodeType
Peer node type
Address
string
Peer address for connection
Peer
type Peer struct {
Info PeerInfo
Client MeshServiceClient
Conn *grpc.ClientConn
}
Field
Type
Description
Info
PeerInfo
Peer metadata
Client
MeshServiceClient
gRPC client for mesh operations
Conn
*grpc.ClientConn
Underlying connection
Topology
type Topology struct {
Nodes map[string]NodeInfo
Version int64
UpdatedAt time.Time
}
Field
Type
Description
Nodes
map[string]NodeInfo
Node ID to info mapping
Version
int64
Monotonically increasing version
UpdatedAt
time.Time
Last modification time
Caller
type Caller struct {
NodeID string
Certificate *x509.Certificate
}
Field
Type
Description
NodeID
string
Calling node's ID (from certificate CN)
Certificate
*x509.Certificate
Full client certificate
HealthInfo
type HealthInfo struct {
Status HealthStatus
LastChecked time.Time
Message string
Error string
}
var (
ErrNoProviders = errors.New("no providers available for service")
ErrNoTLSConfig = errors.New("node has no TLS configuration")
ErrNoPeerInfo = errors.New("no peer info in context")
ErrNoTLSInfo = errors.New("no TLS info in peer")
ErrNoCertificate = errors.New("no client certificate")
)