mirror of
https://github.com/nats-io/nats.go.git
synced 2025-09-26 20:41:41 +08:00
[ADDED] New fields in ClusterInfo (#1935)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
This commit is contained in:

committed by
Piotr Piotrowski

parent
460f3ded59
commit
3416ed073b
@@ -279,10 +279,25 @@ type (
|
||||
// Name is the name of the cluster.
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// RaftGroup is the name of the Raft group managing the asset (in
|
||||
// clustered environments).
|
||||
RaftGroup string `json:"raft_group,omitempty"`
|
||||
|
||||
// Leader is the server name of the RAFT leader.
|
||||
Leader string `json:"leader,omitempty"`
|
||||
|
||||
// Replicas is the list of members of the RAFT cluster
|
||||
// LeaderSince is the time that it was elected as leader in RFC3339
|
||||
// format, absent when not the leader.
|
||||
LeaderSince *time.Time `json:"leader_since,omitempty"`
|
||||
|
||||
// SystemAcc indicates if the traffic_account is the system account.
|
||||
// When true, replication traffic goes over the system account.
|
||||
SystemAcc bool `json:"system_account,omitempty"`
|
||||
|
||||
// TrafficAcc is the account where the replication traffic goes over.
|
||||
TrafficAcc string `json:"traffic_account,omitempty"`
|
||||
|
||||
// Replicas is the list of members of the RAFT cluster.
|
||||
Replicas []*PeerInfo `json:"replicas,omitempty"`
|
||||
}
|
||||
|
||||
|
10
jsm.go
10
jsm.go
@@ -1093,9 +1093,13 @@ type StreamState struct {
|
||||
// ClusterInfo shows information about the underlying set of servers
|
||||
// that make up the stream or consumer.
|
||||
type ClusterInfo struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Leader string `json:"leader,omitempty"`
|
||||
Replicas []*PeerInfo `json:"replicas,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
RaftGroup string `json:"raft_group,omitempty"`
|
||||
Leader string `json:"leader,omitempty"`
|
||||
LeaderSince *time.Time `json:"leader_since,omitempty"`
|
||||
SystemAcc bool `json:"system_account,omitempty"`
|
||||
TrafficAcc string `json:"traffic_account,omitempty"`
|
||||
Replicas []*PeerInfo `json:"replicas,omitempty"`
|
||||
}
|
||||
|
||||
// PeerInfo shows information about all the peers in the cluster that
|
||||
|
Reference in New Issue
Block a user