configValidator ensures that the configuration is valid and returns an error if it is not.
(config *NodeConfig)
| 120 | // configValidator ensures that the configuration is valid and returns an error |
| 121 | // if it is not. |
| 122 | func configValidator(config *NodeConfig) error { |
| 123 | if config == nil { |
| 124 | return errors.New("must supply a non-nil config") |
| 125 | } |
| 126 | |
| 127 | if config.Replicas < 1 { |
| 128 | return errors.New("must have at least one replica") |
| 129 | } |
| 130 | |
| 131 | return nil |
| 132 | } |
| 133 | |
| 134 | // initSerf initializes serf and advertizes this nodes RPC port to other nodes. |
| 135 | func (n *Node) initSerf(config *serf.Config) error { |