Documentation ¶
Index ¶
- func NewGitlabFetcher(conf GitlabFetcherConfig) goproxy.Fetcher
- func Save(ctx context.Context, input io.Reader) (io.ReadSeekCloser, int64, error)
- func UnzipArchiveFromGitlab(workspace string, depth int, archive string) error
- type Config
- type GitLab
- type GitlabFetcher
- func (gh *GitlabFetcher) Archive(ctx context.Context, loc *Locator, path, version string) (io.ReadSeekCloser, error)
- func (gf *GitlabFetcher) Download(ctx context.Context, path, version string) (info, mod, zip io.ReadSeekCloser, err error)
- func (gf *GitlabFetcher) Extract(ctx context.Context, path, query string) (*Locator, error)
- func (gf *GitlabFetcher) ExtractSubPath(ctx context.Context, path string) (string, []string, string, error)
- func (gf *GitlabFetcher) List(ctx context.Context, path string) ([]string, error)
- func (gf *GitlabFetcher) NeedFetch(path string) bool
- func (gf *GitlabFetcher) Query(ctx context.Context, path, query string) (string, time.Time, error)
- func (gf *GitlabFetcher) SaveGoMod(ctx context.Context, loc *Locator) (io.ReadSeekCloser, error)
- func (gf *GitlabFetcher) SaveInfo(ctx context.Context, loc *Locator) (io.ReadSeekCloser, error)
- type GitlabFetcherConfig
- type GitlabHost
- func (gh *GitlabHost) Download(ctx context.Context, repo, dir, ref string) (io.Reader, error)
- func (gh *GitlabHost) GetFile(ctx context.Context, repo, path, ref string) ([]byte, error)
- func (gh *GitlabHost) GetTag(ctx context.Context, repo, tag string) (*Info, error)
- func (gh *GitlabHost) IsProject(ctx context.Context, repo string) (bool, error)
- func (gh *GitlabHost) ListTags(ctx context.Context, repo string, prefix string) ([]*Info, error)
- type Info
- type Locator
- type MixedFetcher
- func (mf *MixedFetcher) Download(ctx context.Context, path string, version string) (io.ReadSeekCloser, io.ReadSeekCloser, io.ReadSeekCloser, error)
- func (mf *MixedFetcher) List(ctx context.Context, path string) ([]string, error)
- func (mf *MixedFetcher) Query(ctx context.Context, path string, query string) (string, time.Time, error)
- type SmartFile
- type UpstreamConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitlabFetcher ¶
func NewGitlabFetcher(conf GitlabFetcherConfig) goproxy.Fetcher
Types ¶
type Config ¶
type Config struct { Masks []GitlabFetcherConfig `json:"masks" yaml:"masks" toml:"masks"` Upstream UpstreamConfig `json:"upstream" yaml:"upstream" toml:"upstream"` }
type GitLab ¶
type GitLab interface { ListTags(ctx context.Context, repository string, prefix string) ([]*Info, error) GetTag(ctx context.Context, repository, tag string) (*Info, error) GetFile(ctx context.Context, repository, path, ref string) ([]byte, error) Download(ctx context.Context, repository, dir, ref string) (io.Reader, error) // https://go.dev/ref/mod#zip-files, TODO: 主module的zip文件里不包含任何子module,子module的zip中只包含自身文件 IsProject(context.Context, string) (bool, error) }
type GitlabFetcher ¶
type GitlabFetcher struct {
// contains filtered or unexported fields
}
func (*GitlabFetcher) Archive ¶
func (gh *GitlabFetcher) Archive(ctx context.Context, loc *Locator, path, version string) (io.ReadSeekCloser, error)
func (*GitlabFetcher) Download ¶
func (gf *GitlabFetcher) Download(ctx context.Context, path, version string) (info, mod, zip io.ReadSeekCloser, err error)
Download ..
func (*GitlabFetcher) ExtractSubPath ¶
func (*GitlabFetcher) List ¶
List 通过Git Repository的Tag列表返回查询结果
gitlab/wongidle/foobar -> [v0.1.0, v0.1.1] gitlab/wongidle/foobar/internal -> error gitlab/wongidle/foobar/pkg -> [v0.2.0, v0.2.1] -> [pkg/v0.2.0, pkg/v0.2.1]
func (*GitlabFetcher) NeedFetch ¶
func (gf *GitlabFetcher) NeedFetch(path string) bool
func (*GitlabFetcher) Query ¶
Query: - gitlab.com/wongidle/foobar v0.1.1 -> wongidle/foobar v0.1.1 - gitlab.com/wongidle/foobar/internal v0.1.1
- good: wongidle/foobar | internal | internal/v0.1.1
- bad: wongidle/foobar |
func (*GitlabFetcher) SaveGoMod ¶
func (gf *GitlabFetcher) SaveGoMod(ctx context.Context, loc *Locator) (io.ReadSeekCloser, error)
func (*GitlabFetcher) SaveInfo ¶
func (gf *GitlabFetcher) SaveInfo(ctx context.Context, loc *Locator) (io.ReadSeekCloser, error)
type GitlabFetcherConfig ¶
type GitlabHost ¶
type GitlabHost struct {
// contains filtered or unexported fields
}
func NewGitlabHost ¶
func NewGitlabHost(conf GitlabFetcherConfig) *GitlabHost
type MixedFetcher ¶
type MixedFetcher struct { Masks []*GitlabFetcher Upstream goproxy.Fetcher }
func NewMixedFetcher ¶
func NewMixedFetcher(conf Config) *MixedFetcher
func (*MixedFetcher) Download ¶
func (mf *MixedFetcher) Download(ctx context.Context, path string, version string) (io.ReadSeekCloser, io.ReadSeekCloser, io.ReadSeekCloser, error)
type UpstreamConfig ¶
type UpstreamConfig struct {
Proxy string `json:"proxy" yaml:"proxy" toml:"proxy"`
}
Click to show internal directories.
Click to hide internal directories.