github

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *httputil.HTTPClient
}

Client contains the HTTPClient used to communicate with the GitHubAPI

func NewGithubClient

func NewGithubClient(c *httputil.HTTPClient) *Client

NewGithubClient returns a HTTP client for interfacing with github

func (*Client) GithubRequest

func (c *Client) GithubRequest(url string, method string) (*httputil.HTTPResponse, error)

GithubRequest Sends an http request to github and returns a basic response obj

func (*Client) RepoLatestRequest

func (c *Client) RepoLatestRequest(orgName string, repoName string) (*RepoLatestResponse, error)

RepoLatestRequest Makes a request to grab the latest release of a github repository

func (*Client) RepoTagRequest

func (c *Client) RepoTagRequest(orgName string, repoName string, tagName string) (*RepoLatestResponse, error)

RepoTagRequest makes a request to grab a specific tag of a github repository

type RepoLatestResponse

type RepoLatestResponse struct {
	Url         string    `json:"url"`
	TagName     string    `json:"tag_name"`
	Draft       bool      `json:"draft"`
	CreatedAt   time.Time `json:"created_at"`
	PublishedAt time.Time `json:"published_at"`
}

RepoLatestResponse represents a tag info response from Github API

Jump to

Keyboard shortcuts

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