1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 21:59:42 +02:00

Moved from Dep to Go Modules

We have finally dropped go dep and moved over to go mod !

During the move, some dependencies have been bumped.
This commit is contained in:
HarveyKandola 2019-09-06 11:06:28 +01:00
parent 2c164a135a
commit b826852137
164 changed files with 18268 additions and 10658 deletions

View file

@ -20,6 +20,7 @@ type UsersService service
type User struct {
Login *string `json:"login,omitempty"`
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
AvatarURL *string `json:"avatar_url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
GravatarID *string `json:"gravatar_id,omitempty"`
@ -134,12 +135,65 @@ func (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response,
return uResp, resp, nil
}
// HovercardOptions specifies optional parameters to the UsersService.GetHovercard
// method.
type HovercardOptions struct {
// SubjectType specifies the additional information to be received about the hovercard.
// Possible values are: organization, repository, issue, pull_request. (Required when using subject_id.)
SubjectType string `url:"subject_type"`
// SubjectID specifies the ID for the SubjectType. (Required when using subject_type.)
SubjectID string `url:"subject_id"`
}
// Hovercard represents hovercard information about a user.
type Hovercard struct {
Contexts []*UserContext `json:"contexts,omitempty"`
}
// UserContext represents the contextual information about user.
type UserContext struct {
Message *string `json:"message,omitempty"`
Octicon *string `json:"octicon,omitempty"`
}
// GetHovercard fetches contextual information about user. It requires authentication
// via Basic Auth or via OAuth with the repo scope.
//
// GitHub API docs: https://developer.github.com/v3/users/#get-contextual-information-about-a-user
func (s *UsersService) GetHovercard(ctx context.Context, user string, opt *HovercardOptions) (*Hovercard, *Response, error) {
u := fmt.Sprintf("users/%v/hovercard", user)
u, err := addOptions(u, opt)
if err != nil {
return nil, nil, err
}
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeHovercardPreview)
hc := new(Hovercard)
resp, err := s.client.Do(ctx, req, hc)
if err != nil {
return nil, resp, err
}
return hc, resp, nil
}
// UserListOptions specifies optional parameters to the UsersService.ListAll
// method.
type UserListOptions struct {
// ID of the last user seen
Since int64 `url:"since,omitempty"`
// Note: Pagination is powered exclusively by the Since parameter,
// ListOptions.Page has no effect.
// ListOptions.PerPage controls an undocumented GitHub API parameter.
ListOptions
}