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

Method persistServerMetadata

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

Source from the content-addressed store, hash-verified

212}
213
214func (api *API) persistServerMetadata(name string, ipAddress string, port int, transaction string, version int64) {
215 newServer := &models.Server{
216 Name: name,
217 Address: ipAddress,
218 Port: Int64Ptr(port),
219 Check: models.ServerCheckEnabled,
220 Inter: Int64Ptr(ServerHealthCheckInterval), // ms; default fall: 3, default rise: 2
221 }
222
223 err := api.client.Configuration.CreateServer(DataplaneBackend, newServer, transaction, version)
224 if err != nil {
225 logrus.Errorf("Error adding data plane with address %s:%d to the load balancer - %v", ipAddress, port, err)
226 }
227}
228
229func (api *API) removeServerByName(ipAddress string, port int, transaction string, version int64) {
230 url := fmt.Sprintf("%s:%d", ipAddress, port)

Callers 1

addServerMethod · 0.95

Calls 1

Int64PtrFunction · 0.85

Tested by

no test coverage detected