MCPcopy Create free account
hub / github.com/dadgar/onecache / configValidator

Function configValidator

onecache/onecache.go:122–132  ·  view source on GitHub ↗

configValidator ensures that the configuration is valid and returns an error if it is not.

(config *NodeConfig)

Source from the content-addressed store, hash-verified

120// configValidator ensures that the configuration is valid and returns an error
121// if it is not.
122func 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.
135func (n *Node) initSerf(config *serf.Config) error {

Callers 1

CreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected