Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserFilter ¶
type UserFilter struct { Lang string // programming language, not to be confused with human language. Location string // If nil, default is 100. PerPage int // Page is used for pagination. // Page < 1 means do not use this as query param. Page int }
UserFilter defines the filter criteria use to search a user.
func NewFilter ¶
func NewFilter(lang, loc string, perPage, page int) *UserFilter
NewFilter returns new filter object.
type UserSearch ¶
type UserSearch struct { Login string `json:"login"` ID int `json:"id"` NodeID string `json:"node_id"` AvatarURL string `json:"avatar_url"` URL string `json:"url"` HTMLURL string `json:"html_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` Score float64 `json:"score"` }
UserSearch is used to map the response of user search API.
func Users ¶
func Users(filter *UserFilter) []UserSearch
Users searches github users based on the filter criteria.
type UserSearchResponse ¶
type UserSearchResponse struct { TotalCount int `json:"total_count"` IncompleteResult bool `json:"incomplete_results"` Items []UserSearch `json:"items"` }
UserSearchResponse is used to map the response returned when a users are searched based on the filter query.
Click to show internal directories.
Click to hide internal directories.