Documentation ¶
Index ¶
- func Get(client *http.Client, url string) (out []byte, err error)
- func GetOauthInfo(client *http.Client) (out []byte, err error)
- func JsonToMap(body io.ReadCloser) (outStr string, err error)
- func JsonToStruct(data []byte) (out string, err error)
- func Post(client *http.Client, url string, jsonBytes []byte) (out []byte, err error)
- func SaveJsonToStruct(body io.ReadCloser) (err error)
- func WriteRawFile(resp *http.Response) (err error)
- type BranchHead
- type BranchNew
- type GitBranches
- type GitMainStruct
- type GitReleases
- type GitSearch
- type GitUsersRepos
- func (g *GitUsersRepos) List(login string) (err error)
- func (g *GitUsersRepos) Read(filename string) (err error)
- func (g *GitUsersRepos) ReposNew(newRepos *UserReposNew) (out []byte, err error)
- func (g *GitUsersRepos) ReposRemove(repos string) (out []byte, err error)
- func (g *GitUsersRepos) Write(filename string) (err error)
- type UserReposNew
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOauthInfo ¶
GetOauthInfo: get info like scopes for a client's token
func JsonToStruct ¶
JsonToStruct: convert json to go structure.
func SaveJsonToStruct ¶
func SaveJsonToStruct(body io.ReadCloser) (err error)
func WriteRawFile ¶
writeRawFile: record to file row information recieved from GET command used in developpment to get json data and convert to go struct
Types ¶
type BranchHead ¶
type BranchHead []struct { NodeID string `json:"node_id"` Object struct { Sha string `json:"sha"` Type string `json:"type"` URL string `json:"url"` } `json:"object"` Ref string `json:"ref"` URL string `json:"url"` }
BranchHead: Used to retrieve "head branch" when using https://api.github.com/repos/USER/REPO/git/refs/heads
type GitBranches ¶
type GitBranches struct { Data *branchesData Login string // contains filtered or unexported fields }
https://developer.github.com/v3/repos/branches/
func (*GitBranches) List ¶
func (g *GitBranches) List(login, repos string) (err error)
GetBranches: GET /repos/:owner/:repo/branches
func (*GitBranches) NewFromMaster ¶
func (g *GitBranches) NewFromMaster(user, repos, newBranch string) (out []byte, err error)
NewFromMaster: create new branch
func (*GitBranches) Read ¶
func (g *GitBranches) Read(filename string) (err error)
func (*GitBranches) Write ¶
func (g *GitBranches) Write(filename string) (err error)
type GitMainStruct ¶
type GitMainStruct struct { Login string Oauth2Client *http.Client PersonalAccessToken string GoStruct bool // Structures Branches *GitBranches Releases *GitReleases Search *GitSearch Repos *GitUsersRepos }
func (*GitMainStruct) GitMainStructInit ¶
func (g *GitMainStruct) GitMainStructInit(login, token string)
type GitReleases ¶
type GitReleases struct { Data *releasesData Login string // contains filtered or unexported fields }
GitReleases: https://developer.github.com/v3/repos/releases/
func (*GitReleases) List ¶
func (g *GitReleases) List(login, repos string) (err error)
GetReleases: Information about published releases, https://developer.github.com/v3/repos/releases/
func (*GitReleases) Read ¶
func (g *GitReleases) Read(filename string) (err error)
func (*GitReleases) Write ¶
func (g *GitReleases) Write(filename string) (err error)
type GitSearch ¶
type GitSearch struct { Data *searchData Status string Login string // contains filtered or unexported fields }
GitSearch: https://developer.github.com/v3/search/
func (*GitSearch) For ¶
For: execute a search command. https://developer.github.com/v3/search/ - for a complete list of available qualifiers. https://help.github.com/en/articles/searching-on-github - how to use operators to match specific quantities, dates, or to exclude. https://help.github.com/articles/understanding-the-search-syntax/
type GitUsersRepos ¶
type GitUsersRepos struct { Data *usersReposData Login string // contains filtered or unexported fields }
GitUserRepos: https://developer.github.com/v3/search/
func (*GitUsersRepos) List ¶
func (g *GitUsersRepos) List(login string) (err error)
List: public repositories for the specified user. user repos: GET /users/:username/repos https://developer.github.com/v3/repos/#list-user-repositories
func (*GitUsersRepos) Read ¶
func (g *GitUsersRepos) Read(filename string) (err error)
func (*GitUsersRepos) ReposNew ¶
func (g *GitUsersRepos) ReposNew(newRepos *UserReposNew) (out []byte, err error)
NewRepository: create new repository, "POST /user/repos" UserReposNew need to be initialised with default values before use. https://developer.github.com/v3/repos/#create
func (*GitUsersRepos) ReposRemove ¶
func (g *GitUsersRepos) ReposRemove(repos string) (out []byte, err error)
RemoveRepostory:
func (*GitUsersRepos) Write ¶
func (g *GitUsersRepos) Write(filename string) (err error)
type UserReposNew ¶
type UserReposNew struct { AllowMergeCommit bool `json:"allow_merge_commit"` AllowRebaseMerge bool `json:"allow_rebase_merge"` AllowSquashMerge bool `json:"allow_squash_merge"` AutoInit bool `json:"auto_init"` Description string `json:"description"` HasIssues bool `json:"has_issues"` HasProjects bool `json:"has_projects"` HasWiki bool `json:"has_wiki"` Homepage string `json:"homepage"` IsTemplate bool `json:"is_template"` Name string `json:"name"` Private bool `json:"private"` }
func (*UserReposNew) InitDefault ¶
func (r *UserReposNew) InitDefault(reposName, description string)