MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / removeRaftPeer

Function removeRaftPeer

cmd/client/command/raft.go:155–175  ·  view source on GitHub ↗
(cli *client, id uint64)

Source from the content-addressed store, hash-verified

153}
154
155func removeRaftPeer(cli *client, id uint64) error {
156 var request struct {
157 ID uint64 `json:"id"`
158 Operation string `json:"operation"`
159 }
160 request.ID = id
161 request.Operation = "remove"
162
163 rsp, err := cli.restyCli.R().
164 SetBody(&request).
165 Post("/raft/peers")
166 if err != nil {
167 return err
168 }
169 if rsp.IsError() {
170 return unmarshalError(rsp.Body())
171 }
172
173 printLine("Remove node '%d' successfully", id)
174 return nil
175}

Callers 1

raft.goFile · 0.85

Calls 2

unmarshalErrorFunction · 0.85
printLineFunction · 0.85

Tested by

no test coverage detected