Documentation
¶
Index ¶
- Variables
- func ConcurrentUpload(httpClient httpDoer, uploadURL string, numWorkers int, ...) error
- func FetchRefSHA(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface, ...) (string, error)
- func FilterAttestationsByFileDigest(attestations []*api.Attestation, fileDigest string) ([]*api.Attestation, error)
- func FilterAttestationsByTag(attestations []*api.Attestation, tagName string) ([]*api.Attestation, error)
- func StubFetchRefSHA(t *testing.T, reg *httpmock.Registry, owner, repoName, tagName, sha string)
- func StubFetchRelease(t *testing.T, reg *httpmock.Registry, ...)
- type AssetForUpload
- type AttestationVerifier
- type MockVerifier
- type Release
- type ReleaseAsset
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReleaseNotFound = errors.New("release not found")
View Source
var ReleaseFields = []string{
"apiUrl",
"author",
"assets",
"body",
"createdAt",
"databaseId",
"id",
"isDraft",
"isPrerelease",
"isImmutable",
"name",
"publishedAt",
"tagName",
"tarballUrl",
"targetCommitish",
"uploadUrl",
"url",
"zipballUrl",
}
Functions ¶
func ConcurrentUpload ¶
func ConcurrentUpload(httpClient httpDoer, uploadURL string, numWorkers int, assets []*AssetForUpload) error
func FetchRefSHA ¶ added in v2.75.0
func FilterAttestationsByFileDigest ¶ added in v2.75.0
func FilterAttestationsByFileDigest(attestations []*api.Attestation, fileDigest string) ([]*api.Attestation, error)
func FilterAttestationsByTag ¶ added in v2.75.0
func FilterAttestationsByTag(attestations []*api.Attestation, tagName string) ([]*api.Attestation, error)
func StubFetchRefSHA ¶ added in v2.75.0
Types ¶
type AssetForUpload ¶
type AssetForUpload struct {
Name string
Label string
Size int64
MIMEType string
Open func() (io.ReadCloser, error)
ExistingURL string
}
func AssetsFromArgs ¶
func AssetsFromArgs(args []string) (assets []*AssetForUpload, err error)
type AttestationVerifier ¶ added in v2.75.0
type AttestationVerifier struct {
AttClient api.Client
HttpClient *http.Client
IO *iostreams.IOStreams
TrustedRoot string
}
func (*AttestationVerifier) VerifyAttestation ¶ added in v2.75.0
func (v *AttestationVerifier) VerifyAttestation(art *artifact.DigestedArtifact, att *api.Attestation) (*verification.AttestationProcessingResult, error)
type MockVerifier ¶ added in v2.75.0
type MockVerifier struct {
// contains filtered or unexported fields
}
func NewMockVerifier ¶ added in v2.75.0
func NewMockVerifier(mockResult *verification.AttestationProcessingResult) *MockVerifier
func (*MockVerifier) VerifyAttestation ¶ added in v2.75.0
func (v *MockVerifier) VerifyAttestation(art *artifact.DigestedArtifact, att *api.Attestation) (*verification.AttestationProcessingResult, error)
type Release ¶
type Release struct {
DatabaseID int64 `json:"id"`
ID string `json:"node_id"`
TagName string `json:"tag_name"`
Name string `json:"name"`
Body string `json:"body"`
IsDraft bool `json:"draft"`
IsPrerelease bool `json:"prerelease"`
IsImmutable bool `json:"immutable"`
CreatedAt time.Time `json:"created_at"`
PublishedAt *time.Time `json:"published_at"`
TargetCommitish string `json:"target_commitish"`
APIURL string `json:"url"`
UploadURL string `json:"upload_url"`
TarballURL string `json:"tarball_url"`
ZipballURL string `json:"zipball_url"`
URL string `json:"html_url"`
Assets []ReleaseAsset
Author struct {
ID string `json:"node_id"`
Login string `json:"login"`
}
}
func FetchLatestRelease ¶
func FetchLatestRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface) (*Release, error)
FetchLatestRelease finds the latest published release for a repository.
func FetchRelease ¶
func FetchRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface, tagName string) (*Release, error)
FetchRelease finds a published repository release by its tagName, or a draft release by its pending tag name.
func (*Release) ExportData ¶
type ReleaseAsset ¶
type ReleaseAsset struct {
ID string `json:"node_id"`
Name string
Label string
Size int64
Digest *string
State string
APIURL string `json:"url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DownloadCount int `json:"download_count"`
ContentType string `json:"content_type"`
BrowserDownloadURL string `json:"browser_download_url"`
}
type Verifier ¶ added in v2.75.0
type Verifier interface {
// VerifyAttestation verifies the attestation for a given artifact
VerifyAttestation(art *artifact.DigestedArtifact, att *api.Attestation) (*verification.AttestationProcessingResult, error)
}
Click to show internal directories.
Click to hide internal directories.