Documentation ¶
Index ¶
- Constants
- type DataSource
- type GithubRESTAPI
- func (ds GithubRESTAPI) GetOrgs(ctx context.Context, token string) ([]byte, error)
- func (ds GithubRESTAPI) GetOrgsRepos(ctx context.Context, token string, orgs []entity.Organization) ([][]byte, error)
- func (ds GithubRESTAPI) GetReposPullRequests(ctx context.Context, token string, repos []entity.Repository) ([][]byte, error)
- func (ds GithubRESTAPI) GetScopes(ctx context.Context, token string) ([]string, error)
- func (ds GithubRESTAPI) GetUser(ctx context.Context, token string) ([]byte, error)
Constants ¶
View Source
const ( // OAUTH2_HEADER key for Oauth token in request header. OAUTH2_HEADER = "Authorization" // OAUTH2_PREFIX Prefix for Oauth token. OAUTH2_PREFIX = "Bearer " // SCOPES_HEADER key for github oauth scopes in request header. SCOPES_HEADER = "X-Oauth-Scopes" // USER_QUERY api url for current user. USER_QUERY = "https://api.github.com/user" // ORGS_QUERY api url for orgs of current user. ORGS_QUERY = "https://api.github.com/user/orgs" )
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) GetOrgsRepos(context.Context, string, []entity.Organization) ([][]byte, error) GetReposPullRequests(context.Context, string, []entity.Repository) ([][]byte, error) }
DataSource is an interface for github apis (REST, GRAPH-QL).
type GithubRESTAPI ¶
type GithubRESTAPI struct {
// contains filtered or unexported fields
}
GithubRESTAPI is an implentation of data source for REST Github API v3.
func NewGithubRESTAPI ¶ added in v0.2.2
func NewGithubRESTAPI() *GithubRESTAPI
NewGithubRESTAPI constructor for GithubRESTAPI struct.
func (GithubRESTAPI) GetOrgsRepos ¶ added in v0.2.2
func (ds GithubRESTAPI) GetOrgsRepos(ctx context.Context, token string, orgs []entity.Organization) ([][]byte, error)
GetOrgsRepos returns body with orgs repos.
func (GithubRESTAPI) GetReposPullRequests ¶ added in v0.2.2
func (ds GithubRESTAPI) GetReposPullRequests(ctx context.Context, token string, repos []entity.Repository) ([][]byte, error)
GetReposPullRequests returns body with orgs repos pulls.
Click to show internal directories.
Click to hide internal directories.