githubwrapper

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 7 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Github Wrapper

A Package for Gihtub Integration HRM Application for project 3

Progress Status

Last Edited 11 November

How to use

Install

go get -u github.com/HRMonitorr/githubwrapper

List Function

  • Make Clients
  • GetBranches
  • GetCommit
  • Listrepositories
  • ListRepositories Detail

Documentation

Index

Constants

View Source
const UrlApigit = "https://api.github.com/repos"

Variables

This section is empty.

Functions

func GetBranch added in v0.0.2

func GetBranch(ctx context.Context, personalToken, repoName, ownerName string) ([]*github.Branch, error)

func GetCommit

func GetCommit(ctx context.Context, personalToken, repoName, ownerName, sha string) (*github.RepositoryCommit, error)

func ListCommitALL

func ListCommitALL(ctx context.Context, PersonalToken, repoName, ownerName string) ([]*github.RepositoryCommit, error)

func ListRepositoriesOrg added in v0.0.2

func ListRepositoriesOrg(ctx context.Context, personalToken, OrgName string) (dest []*github.Repository, err error)

func MakeClient

func MakeClient(personalToken string) *github.Client

func MakeIssue added in v0.0.6

func MakeIssue(ctx context.Context, personalToken, repoName, OwnerName string, value github.IssueRequest) (*github.Response, error)

func UploadFileToRepository added in v0.0.3

func UploadFileToRepository(val PushRepositories) (response *github.RepositoryContentResponse, err error)

Types

type Commit

type Commit struct {
	Type  string `json:"type"`
	Items struct {
		Title       string `json:"title"`
		Description string `json:"description"`
		Type        string `json:"type"`
		Properties  struct {
			URL         string `json:"url"`
			SHA         string `json:"sha"`
			NodeID      string `json:"node_id"`
			HTMLURL     string `json:"html_url"`
			CommentsURL string `json:"comments_url"`
			Commit      struct {
				URL    string `json:"url"`
				Author struct {
					Name  string `json:"name"`
					Email string `json:"email"`
					Date  string `json:"date"`
				} `json:"author"`
				Committer struct {
					Name  string `json:"name"`
					Email string `json:"email"`
					Date  string `json:"date"`
				} `json:"committer"`
				Message      string `json:"message"`
				CommentCount int    `json:"comment_count"`
				Tree         struct {
					SHA string `json:"sha"`
					URL string `json:"url"`
				} `json:"tree"`
				Verification struct {
					Verified  bool   `json:"verified"`
					Reason    string `json:"reason"`
					Payload   string `json:"payload"`
					Signature string `json:"signature"`
				} `json:"verification"`
			} `json:"commit"`
			Author struct {
				Name              string `json:"name"`
				Email             string `json:"email"`
				Login             string `json:"login"`
				ID                int    `json:"id"`
				NodeID            string `json:"node_id"`
				AvatarURL         string `json:"avatar_url"`
				GravatarID        string `json:"gravatar_id"`
				URL               string `json:"url"`
				HTMLURL           string `json:"html_url"`
				FollowersURL      string `json:"followers_url"`
				FollowingURL      string `json:"following_url"`
				GistsURL          string `json:"gists_url"`
				StarredURL        string `json:"starred_url"`
				SubscriptionsURL  string `json:"subscriptions_url"`
				OrganizationsURL  string `json:"organizations_url"`
				ReposURL          string `json:"repos_url"`
				EventsURL         string `json:"events_url"`
				ReceivedEventsURL string `json:"received_events_url"`
				Type              string `json:"type"`
				SiteAdmin         bool   `json:"site_admin"`
				StarredAt         string `json:"starred_at"`
			} `json:"author"`
			Committer struct {
				Name              string `json:"name"`
				Email             string `json:"email"`
				Login             string `json:"login"`
				ID                int    `json:"id"`
				NodeID            string `json:"node_id"`
				AvatarURL         string `json:"avatar_url"`
				GravatarID        string `json:"gravatar_id"`
				URL               string `json:"url"`
				HTMLURL           string `json:"html_url"`
				FollowersURL      string `json:"followers_url"`
				FollowingURL      string `json:"following_url"`
				GistsURL          string `json:"gists_url"`
				StarredURL        string `json:"starred_url"`
				SubscriptionsURL  string `json:"subscriptions_url"`
				OrganizationsURL  string `json:"organizations_url"`
				ReposURL          string `json:"repos_url"`
				EventsURL         string `json:"events_url"`
				ReceivedEventsURL string `json:"received_events_url"`
				Type              string `json:"type"`
				SiteAdmin         bool   `json:"site_admin"`
				StarredAt         string `json:"starred_at"`
			} `json:"committer"`
			Parents struct {
				Type  string `json:"type"`
				Items struct {
					Sha     string `json:"sha"`
					URL     string `json:"url"`
					HTMLURL string `json:"html_url"`
				} `json:"items"`
			} `json:"parents"`
			Stats struct {
				Type       string `json:"type"`
				Properties struct {
					Additions int `json:"additions"`
					Deletions int `json:"deletions"`
					Total     int `json:"total"`
				} `json:"properties"`
			} `json:"stats"`
			Files struct {
				Type  string `json:"type"`
				Items struct {
					Title       string `json:"title"`
					Description string `json:"description"`
					Type        string `json:"type"`
					Properties  struct {
						SHA              string `json:"sha"`
						Filename         string `json:"filename"`
						Status           string `json:"status"`
						Additions        int    `json:"additions"`
						Deletions        int    `json:"deletions"`
						Changes          int    `json:"changes"`
						BlobURL          string `json:"blob_url"`
						RawURL           string `json:"raw_url"`
						ContentsURL      string `json:"contents_url"`
						Patch            string `json:"patch"`
						PreviousFilename string `json:"previous_filename"`
					} `json:"properties"`
				} `json:"items"`
			} `json:"files"`
		} `json:"items"`
	} `json:"items"`
}

type IssueRequest added in v0.0.6

type IssueRequest struct {
	Title    string   `json:"title,omitempty"`
	Body     string   `json:"body,omitempty"`
	Labels   []string `json:"labels,omitempty"`
	Assignee string   `json:"assignee,omitempty"`
	State    string   `json:"state,omitempty"`
	// StateReason can be 'completed' or 'not_planned'.
	StateReason string   `json:"state_reason,omitempty"`
	Milestone   int      `json:"milestone,omitempty"`
	Assignees   []string `json:"assignees,omitempty"`
}

type PushRepositories added in v0.0.4

type PushRepositories struct {
	Context       context.Context `json:"context"`
	PersonalToken string          `json:"personalToken"`
	Reponame      string          `json:"reponame"`
	OwnerName     string          `json:"ownerName"`
	Path          string          `json:"path"`
	Username      string          `json:"username"`
	Email         string          `json:"email"`
	Message       string          `json:"message"`
	Branch        string          `json:"branch"`
}

type Repositories added in v0.0.2

type Repositories struct {
	Name     *string `json:"name"`
	FullName *string `json:"full-name"`
	Homepage *string `json:"homepage"`
}

func ListRepositoriesOnlydDetail added in v0.0.2

func ListRepositoriesOnlydDetail(ctx context.Context, personalToken, OrgName string) (dest []Repositories, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL