internal

package
v0.0.0-...-bd5852e Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checksummer

type Checksummer struct{}

func NewChecksummer

func NewChecksummer() Checksummer

func (Checksummer) GetSHA256

func (c Checksummer) GetSHA256(path string) (string, error)

func (Checksummer) GetSHA512

func (c Checksummer) GetSHA512(path string) (string, error)

func (Checksummer) SplitPGPKeys

func (c Checksummer) SplitPGPKeys(block string) []string

func (Checksummer) VerifyASC

func (c Checksummer) VerifyASC(asc, path string, pgpKeys ...string) error

func (Checksummer) VerifyMD5

func (c Checksummer) VerifyMD5(path, expectedMD5 string) error

func (Checksummer) VerifySHA1

func (c Checksummer) VerifySHA1(path, expectedSHA string) error

func (Checksummer) VerifySHA256

func (c Checksummer) VerifySHA256(path, expectedSHA string) error

func (Checksummer) VerifySHA512

func (c Checksummer) VerifySHA512(path, expectedSHA string) error

type FileSystem

type FileSystem struct{}

func NewFileSystem

func NewFileSystem() FileSystem

func (FileSystem) WriteFile

func (f FileSystem) WriteFile(filename, contents string) error

type GithubAnnotatedTagResponse

type GithubAnnotatedTagResponse struct {
	Tagger struct {
		Date time.Time `json:"date"`
	} `json:"tagger"`
	Object struct {
		SHA string `json:"sha"`
	} `json:"object"`
}

type GithubClient

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

func NewGithubClient

func NewGithubClient(webClient GithubWebClient, accessToken string) GithubClient

func (GithubClient) DownloadReleaseAsset

func (g GithubClient) DownloadReleaseAsset(org, repo, tag, assetName, outputPath string) (string, error)

func (GithubClient) DownloadSourceTarball

func (g GithubClient) DownloadSourceTarball(org, repo, ref, outputPath string) (string, error)

func (GithubClient) GetReleaseAsset

func (g GithubClient) GetReleaseAsset(org, repo, tag, assetName string) ([]byte, error)

func (GithubClient) GetReleaseDate

func (g GithubClient) GetReleaseDate(org, repo, tag string) (*time.Time, error)

func (GithubClient) GetReleaseTags

func (g GithubClient) GetReleaseTags(org, repo string) ([]GithubRelease, error)

func (GithubClient) GetTagCommit

func (g GithubClient) GetTagCommit(org, repo, tag string) (GithubTagCommit, error)

func (GithubClient) GetTags

func (g GithubClient) GetTags(org, repo string) ([]string, error)

type GithubCommitResponse

type GithubCommitResponse struct {
	SHA       string `json:"sha"`
	Committer struct {
		Date time.Time `json:"date"`
	} `json:"committer"`
}

type GithubGraphQLRequest

type GithubGraphQLRequest struct {
	Query string `json:"query"`
}

type GithubGraphQLTagsResponse

type GithubGraphQLTagsResponse struct {
	Data struct {
		Repository struct {
			Refs struct {
				Edges []struct {
					Node struct {
						Name   string
						Target struct {
							OID string `json:"oid"`
						} `json:"target"`
					} `json:"node"`
				} `json:"edges"`
			} `json:"refs"`
		} `json:"repository"`
	} `json:"data"`
}

type GithubRelease

type GithubRelease struct {
	TagName       string
	PublishedDate time.Time
	CreatedDate   time.Time
}

type GithubReleaseAsset

type GithubReleaseAsset struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type GithubReleaseResponse

type GithubReleaseResponse struct {
	TagName     string               `json:"tag_name"`
	Draft       bool                 `json:"draft"`
	Prerelease  bool                 `json:"prerelease"`
	Assets      []GithubReleaseAsset `json:"assets"`
	PublishedAt time.Time            `json:"published_at"`
	CreatedAt   time.Time            `json:"created_at"`
}

type GithubTagCommit

type GithubTagCommit struct {
	Tag  string
	SHA  string
	Date time.Time
}

type GithubTagResponse

type GithubTagResponse struct {
	Object struct {
		Type string `json:"type"`
		URL  string `json:"url"`
	} `json:"object"`
}

type GithubWebClient

type GithubWebClient interface {
	Get(url string, options ...RequestOption) ([]byte, error)
	Post(url string, body []byte, options ...RequestOption) ([]byte, error)
	Download(url, filename string, options ...RequestOption) error
}

type RequestOption

type RequestOption func(r *http.Request)

func WithHeader

func WithHeader(name, value string) RequestOption

type WebClient

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

func NewWebClient

func NewWebClient() WebClient

func (WebClient) Download

func (w WebClient) Download(url, filename string, options ...RequestOption) error

func (WebClient) Get

func (w WebClient) Get(url string, options ...RequestOption) ([]byte, error)

func (WebClient) Post

func (w WebClient) Post(url string, requestBody []byte, options ...RequestOption) ([]byte, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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