MCPcopy
hub / github.com/hashicorp/memberlist / Create

Function Create

memberlist.go:248–259  ·  view source on GitHub ↗

Create will create a new Memberlist using the given configuration. This will not connect to any other node (see Join) yet, but will start all the listeners to allow other nodes to join this memberlist. After creating a Memberlist, the configuration given should not be modified by the user anymore.

(conf *Config)

Source from the content-addressed store, hash-verified

246// After creating a Memberlist, the configuration given should not be
247// modified by the user anymore.
248func Create(conf *Config) (*Memberlist, error) {
249 m, err := newMemberlist(conf)
250 if err != nil {
251 return nil, err
252 }
253 if err := m.setAlive(); err != nil {
254 _ = m.Shutdown()
255 return nil, err
256 }
257 m.schedule()
258 return m, nil
259}
260
261// Join is used to take an existing Memberlist and attempt to join a cluster
262// by contacting all the given hosts and performing a state sync. Initially,

Callers 15

TestTransport_JoinFunction · 0.85
TestTransport_SendFunction · 0.85
TestCreate_secretKeyFunction · 0.85
TestCreate_keyringOnlyFunction · 0.85
TestCreateFunction · 0.85
TestMemberlist_JoinFunction · 0.85

Calls 4

newMemberlistFunction · 0.85
setAliveMethod · 0.80
scheduleMethod · 0.80
ShutdownMethod · 0.65

Tested by 15

TestTransport_JoinFunction · 0.68
TestTransport_SendFunction · 0.68
TestCreate_secretKeyFunction · 0.68
TestCreate_keyringOnlyFunction · 0.68
TestCreateFunction · 0.68
TestMemberlist_JoinFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…