UserSkills lists user skill metadata for the specified user.
(ctx context.Context, user string)
| 66 | |
| 67 | // UserSkills lists user skill metadata for the specified user. |
| 68 | func (c *ExperimentalClient) UserSkills(ctx context.Context, user string) ([]UserSkillMetadata, error) { |
| 69 | res, err := c.Request(ctx, http.MethodGet, userSkillsPath(user), nil) |
| 70 | if err != nil { |
| 71 | return nil, err |
| 72 | } |
| 73 | defer res.Body.Close() |
| 74 | if res.StatusCode != http.StatusOK { |
| 75 | return nil, ReadBodyAsError(res) |
| 76 | } |
| 77 | var skills []UserSkillMetadata |
| 78 | return skills, json.NewDecoder(res.Body).Decode(&skills) |
| 79 | } |
| 80 | |
| 81 | // UserSkillByName returns a user skill by name. |
| 82 | func (c *ExperimentalClient) UserSkillByName(ctx context.Context, user string, name string) (UserSkill, error) { |