Documentation ¶
Index ¶
- Constants
- func NewGHC(hostName string, rateLimit RateLimitSource, repositories Repositories, git Git, ...) repositoryhosts.RepositoryHost
- type GHC
- func (p *GHC) Accept(uri string) bool
- func (p *GHC) FileTreeFromURL(URL string) ([]string, error)
- func (p *GHC) GetClient() httpclient.Client
- func (p *GHC) GetRateLimit(ctx context.Context) (int, int, time.Time, error)
- func (p *GHC) GetRawFormatLink(absLink string) (string, error)
- func (p *GHC) ManifestFromURL(url string) (string, error)
- func (p *GHC) Name() string
- func (p *GHC) Read(ctx context.Context, uri string) ([]byte, error)
- func (p *GHC) ReadGitInfo(ctx context.Context, uri string) ([]byte, error)
- func (p *GHC) ToAbsLink(source, link string) (string, error)
- type Git
- type GitInfo
- type RateLimitSource
- type Repositories
Constants ¶
const (
// DateFormat defines format for LastModifiedDate & PublishDate
DateFormat = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func NewGHC ¶
func NewGHC(hostName string, rateLimit RateLimitSource, repositories Repositories, git Git, client httpclient.Client, os osshim.Os, acceptedHosts []string, localMappings map[string]string, options manifest.ParsingOptions) repositoryhosts.RepositoryHost
NewGHC creates new GHC resource handler
Types ¶
type GHC ¶
type GHC struct {
// contains filtered or unexported fields
}
GHC implements repositoryhosts.RepositoryHost interface using GitHub manifestadapter with transport level persistent cache.
func (*GHC) FileTreeFromURL ¶
FileTreeFromURL implements manifest.FileSource#FileTreeFromURL
func (*GHC) GetClient ¶
func (p *GHC) GetClient() httpclient.Client
GetClient implements the repositoryhosts.RepositoryHost#GetClient
func (*GHC) GetRateLimit ¶
GetRateLimit implements the repositoryhosts.RepositoryHost#GetRateLimit
func (*GHC) GetRawFormatLink ¶
GetRawFormatLink implements the repositoryhosts.RepositoryHost#GetRawFormatLink
func (*GHC) ManifestFromURL ¶
ManifestFromURL implements manifest.FileSource#ManifestFromURL
func (*GHC) ReadGitInfo ¶
ReadGitInfo implements the repositoryhosts.RepositoryHost#ReadGitInfo
type Git ¶
type Git interface { GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *github.Response, error) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*github.Tree, *github.Response, error) }
Git is an interface needed for faking
type GitInfo ¶
type GitInfo struct { LastModifiedDate *string `json:"lastmod,omitempty"` PublishDate *string `json:"publishdate,omitempty"` Author *github.User `json:"author,omitempty"` Contributors []*github.User `json:"contributors,omitempty"` WebURL *string `json:"weburl,omitempty"` SHA *string `json:"sha,omitempty"` SHAAlias *string `json:"shaalias,omitempty"` Path *string `json:"path,omitempty"` }
GitInfo defines git resource attributes
type RateLimitSource ¶
type RateLimitSource interface {
RateLimits(ctx context.Context) (*github.RateLimits, *github.Response, error)
}
RateLimitSource is an interface needed for faking
type Repositories ¶
type Repositories interface { ListCommits(ctx context.Context, owner, repo string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error) Get(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error) }
Repositories is an interface needed for faking
Directories ¶
Path | Synopsis |
---|---|
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors
|
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors |