Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource interface {
GetUser(context.Context, string) ([]byte, error)
GetScopes(context.Context, string) ([]string, error)
GetOrgs(context.Context, string) ([]byte, error)
}
DataSource is an interface for github apis (REST, GRAPH-QL).
type GithubRESTAPI ¶
type GithubRESTAPI struct {
}
GithubRESTAPI is an implentation of data source for REST Github API v3.
func (GithubRESTAPI) GetOrgs ¶
GetOrgs returns body of request to "https://api.github.com/organizations" for provided Github API access token. Access token should be presented as string. Body is presented as byte array. If http.Get or bodyutil.ReadResponseBody occurs any error, this will be returned.
func (GithubRESTAPI) GetScopes ¶
GetScopes returns scopes provided Github API access token. Access token should be presented as string. Scopes is presented as string array. If http.Get or headerutil.ReadResponseHeader occurs any error, this will be returned.
func (GithubRESTAPI) GetUser ¶
GetUser returns body of request to "https://api.github.com/user" for provided Github API access token. Access token should be presented as string. Body is presented as byte array. If http.Get or bodyutil.ReadResponseBody occurs any error, this will be returned.