MCPcopy
hub / github.com/NVIDIA/aistore / UpdateUser

Function UpdateUser

api/authn/authn.go:36–48  ·  view source on GitHub ↗
(baseParams api.BaseParams, user *User)

Source from the content-addressed store, hash-verified

34}
35
36func UpdateUser(baseParams api.BaseParams, user *User) error {
37 msg := cos.MustMarshal(user)
38 baseParams.Method = http.MethodPut
39 reqParams := api.AllocRp()
40 defer api.FreeRp(reqParams)
41 {
42 reqParams.BaseParams = baseParams
43 reqParams.Path = apc.URLPathUsers.Join(user.ID)
44 reqParams.Body = msg
45 reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}}
46 }
47 return reqParams.DoHTTPRequest()
48}
49
50func DeleteUser(baseParams api.BaseParams, userID string) error {
51 baseParams.Method = http.MethodDelete

Callers 1

updateAuthUserHandlerFunction · 0.92

Calls 5

MustMarshalFunction · 0.92
AllocRpFunction · 0.92
FreeRpFunction · 0.92
JoinMethod · 0.80
DoHTTPRequestMethod · 0.80

Tested by

no test coverage detected