MCPcopy Create free account
hub / github.com/eth-easl/dirigent / addRegistrationServer

Method addRegistrationServer

internal/data_plane/haproxy/manager.go:190–205  ·  view source on GitHub ↗
(ipAddress string, port int, transaction string, version int64)

Source from the content-addressed store, hash-verified

188}
189
190func (api *API) addRegistrationServer(ipAddress string, port int, transaction string, version int64) {
191 name := fmt.Sprintf("%s%d", RegistrationServerPrefix, rand.Int())
192
193 newServer := &models.Server{
194 Name: name,
195 Address: ipAddress,
196 Port: Int64Ptr(port),
197 Check: models.ServerCheckEnabled,
198 Inter: Int64Ptr(ServerHealthCheckInterval), // ms; default fall: 3, default rise: 2
199 }
200
201 err := api.client.Configuration.CreateServer(RegistrationServerBackend, newServer, transaction, version)
202 if err != nil {
203 logrus.Errorf("Error adding registration server with address %s:%d to the load balancer - %v", ipAddress, port, err)
204 }
205}
206
207func Int64Ptr(val int) *int64 {
208 var p = new(int64)

Callers 1

genericReviseMethod · 0.95

Calls 2

Int64PtrFunction · 0.85
IntMethod · 0.80

Tested by

no test coverage detected