github

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubMock

type GithubMock struct {
	// contains filtered or unexported fields
}

func NewMock

func NewMock() GithubMock

func NewMockFromMap

func NewMockFromMap(m map[string]string) GithubMock

func (GithubMock) ResolveHash

func (g GithubMock) ResolveHash(resource string) (string, error)

func (GithubMock) ServeHTTP

func (g GithubMock) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GithubResponse

type GithubResponse struct {
	Message          string `json:"message,omitempty"`
	DocumentationURL string `json:"documentation_url,omitempty"`
	Name             string `json:"name,omitempty"`
	Path             string `json:"path,omitempty"`
	Sha              string `json:"sha,omitempty"`
	Size             int    `json:"size,omitempty"`
	URL              string `json:"url,omitempty"`
	HTMLURL          string `json:"html_url,omitempty"`
	GitURL           string `json:"git_url,omitempty"`
	DownloadURL      string `json:"download_url,omitempty"`
	Type             string `json:"type,omitempty"`
	Content          string `json:"content,omitempty"`
	Encoding         string `json:"encoding,omitempty"`
	Links            struct {
		Self string `json:"self,omitempty"`
		Git  string `json:"git,omitempty"`
		HTML string `json:"html,omitempty"`
	} `json:"_links,omitempty"`
}

type Retriever

type Retriever struct {
	Client  *http.Client
	ApiBase string
	// contains filtered or unexported fields
}

func New

func New(tokens map[string]string) Retriever

New returns a retriever with a key/value pairs of <host>, <token> eg: New("github.com", "abcdef")

func (Retriever) Resolve

func (a Retriever) Resolve(resource string) (string, error)

Resolve Resolves a github resource to its hash

func (Retriever) Retrieve

func (a Retriever) Retrieve(resource string) ([]byte, bool, error)

Jump to

Keyboard shortcuts

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