@@ -35,27 +35,29 @@ import (
3535
3636// Peer contains all persistent settings of a starter.
3737type Peer struct {
38- ID string // Unique of of the peer
39- Address string // IP address of arangodb peer server
40- Port int // Port number of arangodb peer server
41- PortOffset int // Offset to add to base ports for the various servers (agent, coordinator, dbserver)
42- DataDir string // Directory holding my data
43- HasAgentFlag bool `json:"HasAgent"` // If set, this peer is running an agent
44- HasDBServerFlag * bool `json:"HasDBServer,omitempty"` // If set or is nil, this peer is running a dbserver
45- HasCoordinatorFlag * bool `json:"HasCoordinator,omitempty"` // If set or is nil, this peer is running a coordinator
46- IsSecure bool // If set, servers started by this peer are using an SSL connection
38+ ID string // Unique of of the peer
39+ Address string // IP address of arangodb peer server
40+ Port int // Port number of arangodb peer server
41+ PortOffset int // Offset to add to base ports for the various servers (agent, coordinator, dbserver)
42+ DataDir string // Directory holding my data
43+ HasAgentFlag bool `json:"HasAgent"` // If set, this peer is running an agent
44+ HasDBServerFlag * bool `json:"HasDBServer,omitempty"` // If set or is nil, this peer is running a dbserver
45+ HasCoordinatorFlag * bool `json:"HasCoordinator,omitempty"` // If set or is nil, this peer is running a coordinator
46+ HasResilientSingleFlag bool `json:"HasResilientSingle,omitempty"` // If set, this peer is running a resilient single server
47+ IsSecure bool // If set, servers started by this peer are using an SSL connection
4748}
4849
4950// NewPeer initializes a new Peer instance with given values.
50- func NewPeer (id , address string , port , portOffset int , dataDir string , hasAgent , hasDBServer , hasCoordinator , isSecure bool ) Peer {
51+ func NewPeer (id , address string , port , portOffset int , dataDir string , hasAgent , hasDBServer , hasCoordinator , hasResilientSingle , isSecure bool ) Peer {
5152 p := Peer {
52- ID : id ,
53- Address : address ,
54- Port : port ,
55- PortOffset : portOffset ,
56- DataDir : dataDir ,
57- HasAgentFlag : hasAgent ,
58- IsSecure : isSecure ,
53+ ID : id ,
54+ Address : address ,
55+ Port : port ,
56+ PortOffset : portOffset ,
57+ DataDir : dataDir ,
58+ HasAgentFlag : hasAgent ,
59+ IsSecure : isSecure ,
60+ HasResilientSingleFlag : hasResilientSingle ,
5961 }
6062 if ! hasDBServer {
6163 p .HasDBServerFlag = boolRef (false )
@@ -75,6 +77,9 @@ func (p Peer) HasDBServer() bool { return p.HasDBServerFlag == nil || *p.HasDBSe
7577// HasCoordinator returns true if this peer is running a coordinator
7678func (p Peer ) HasCoordinator () bool { return p .HasCoordinatorFlag == nil || * p .HasCoordinatorFlag }
7779
80+ // HasResilientSingle returns true if this peer is running an resilient single server
81+ func (p Peer ) HasResilientSingle () bool { return p .HasResilientSingleFlag }
82+
7883// CreateStarterURL creates a URL to the relative path to the starter on this peer.
7984func (p Peer ) CreateStarterURL (relPath string ) string {
8085 addr := net .JoinHostPort (p .Address , strconv .Itoa (p .Port + p .PortOffset ))
0 commit comments