github

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

README

Access Method gitHub and github - Github Commit Access

Synopsis
type: gitHub/v1

Provided blobs use the following media type for: application/x-tgz

The artifact content is provided as gnu-zipped tar archive

Description

This method implements the access of the content of a git commit stored in a GitHub repository.

Supported specification version is v1

Specification Versions
Version v1

The type specific specification fields are:

  • repoUrl string

    Repository URL with or without scheme.

  • ref (optional) string

    Original ref used to get the commit from

  • commit string

    The sha/id of the git commit

Go Bindings

The go binding can be found here

Documentation

Index

Constants

View Source
const (
	Type   = "gitHub"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Type is the access type of GitHub registry.

View Source
const (
	LegacyType   = "github"
	LegacyTypeV1 = LegacyType + runtime.VersionSeparator + "v1"
)
View Source
const ShaLength = 40

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func Is

func Is(spec accspeccpi.AccessSpec) bool

Types

type AccessSpec

type AccessSpec struct {
	runtime.ObjectVersionedType `json:",inline"`

	// RepoUrl is the repository URL, with host, owner and repository
	RepoURL string `json:"repoUrl"`

	// APIHostname is an optional different hostname for accessing the GitHub REST API
	// for enterprise installations
	APIHostname string `json:"apiHostname,omitempty"`

	// Commit defines the hash of the commit
	Commit string `json:"commit"`
	// contains filtered or unexported fields
}

AccessSpec describes the access for a GitHub registry.

func New

func New(repoURL, apiHostname, commit string, opts ...AccessSpecOptions) *AccessSpec

New creates a new GitHub registry access spec version v1.

func (*AccessSpec) AccessMethod

func (*AccessSpec) Describe

func (a *AccessSpec) Describe(ctx accspeccpi.Context) string

func (*AccessSpec) GetInexpensiveContentVersionIdentity added in v0.3.0

func (a *AccessSpec) GetInexpensiveContentVersionIdentity(access accspeccpi.ComponentVersionAccess) string

func (*AccessSpec) GetType

func (_ *AccessSpec) GetType() string

func (*AccessSpec) GlobalAccessSpec added in v0.3.0

func (a *AccessSpec) GlobalAccessSpec(ctx accspeccpi.Context) accspeccpi.AccessSpec

func (*AccessSpec) IsLocal

func (_ *AccessSpec) IsLocal(accspeccpi.Context) bool

type AccessSpecOptions

type AccessSpecOptions func(s *AccessSpec)

AccessSpecOptions defines a set of options which can be applied to the access spec.

func WithClient

func WithClient(client *http.Client) AccessSpecOptions

WithClient creates an access spec with a custom http client.

func WithDownloader

func WithDownloader(downloader downloader.Downloader) AccessSpecOptions

WithDownloader defines a client with a custom downloader.

type RepositoryService

type RepositoryService interface {
	GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, followRedirects bool) (*url.URL, *github.Response, error)
}

RepositoryService defines capabilities of a GitHub repository.

Jump to

Keyboard shortcuts

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