githubwrapper

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 7 Imported by: 2

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 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 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