Documentation
¶
Index ¶
- func NewGitlabFetcher(conf GitlabFetcherConfig) (goproxy.Fetcher, error)
- func NewS3Cache(conf S3Config) (goproxy.Cacher, error)
- 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 (gf *GitlabFetcher) Archive(fetchCtx, fileCtx 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(fetchCtx, fileCtx context.Context, loc *Locator) (io.ReadSeekCloser, error)
- func (gf *GitlabFetcher) SaveInfo(fetchCtx, fileCtx 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 S3Cache
- type S3Config
- type SmartFile
- type UpstreamConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitlabFetcher ¶
func NewGitlabFetcher(conf GitlabFetcherConfig) (goproxy.Fetcher, error)
Types ¶
type Config ¶
type Config struct {
Masks []GitlabFetcherConfig `json:"masks" yaml:"masks" toml:"masks"`
Upstream UpstreamConfig `json:"upstream" yaml:"upstream" toml:"upstream"`
S3 S3Config `json:"s3" yaml:"s3" toml:"s3"`
}
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: The zip file of the main module does not contain any submodules, and the zip file of the submodule only contains its own files
IsProject(context.Context, string) (bool, error)
}
type GitlabFetcher ¶
type GitlabFetcher struct {
// contains filtered or unexported fields
}
func (*GitlabFetcher) Archive ¶
func (gf *GitlabFetcher) Archive(fetchCtx, fileCtx 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 returns query results via Git Repository Tag list
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(fetchCtx, fileCtx context.Context, loc *Locator) (io.ReadSeekCloser, error)
func (*GitlabFetcher) SaveInfo ¶
func (gf *GitlabFetcher) SaveInfo(fetchCtx, fileCtx 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, error)
type MixedFetcher ¶
type MixedFetcher struct {
Masks []*GitlabFetcher
Upstream goproxy.Fetcher
}
func NewMixedFetcher ¶
func NewMixedFetcher(conf Config) (*MixedFetcher, error)
func (*MixedFetcher) Download ¶
func (mf *MixedFetcher) Download(ctx context.Context, path string, version string) (io.ReadSeekCloser, io.ReadSeekCloser, io.ReadSeekCloser, error)
type S3Cache ¶ added in v0.1.5
type S3Cache struct {
// contains filtered or unexported fields
}
type S3Config ¶ added in v0.1.5
type S3Config struct {
AccessKeyID string `json:"access_key_id" toml:"access_key_id" yaml:"access_key_id"`
SecretAccessKey string `json:"secret_access_key" toml:"secret_access_key" yaml:"secret_access_key"`
Endpoint string `json:"endpoint" toml:"endpoint" yaml:"endpoint"`
DisableTLS bool `json:"disable_tls" toml:"disable_tls" yaml:"disable_tls"`
InsecureSkipVerify bool `json:"insecure_skip_verify" toml:"insecure_skip_verify" yaml:"insecure_skip_verify"`
Bucket string `json:"bucket" toml:"bucket" yaml:"bucket"`
Enable bool `json:"enable" toml:"enable" yaml:"enable"`
}
type UpstreamConfig ¶
type UpstreamConfig struct {
Proxy string `json:"proxy" yaml:"proxy" toml:"proxy"`
}
Click to show internal directories.
Click to hide internal directories.