Documentation ¶
Index ¶
- Variables
- type Config
- type GitHubProxy
- func (g *GitHubProxy) Archive(ctx context.Context, w io.Writer, moduleRoot *ModuleRoot, ...) error
- func (g *GitHubProxy) ArchiveRevision(ctx context.Context, w io.Writer, moduleRoot *ModuleRoot, ...) error
- func (g *GitHubProxy) GetGoMod(ctx context.Context, moduleRoot *ModuleRoot, module *Module, version string) (string, error)
- func (g *GitHubProxy) GetGoModRevision(ctx context.Context, moduleRoot *ModuleRoot, module *Module, ...) (string, error)
- func (g *GitHubProxy) GetInfo(ctx context.Context, moduleRoot *ModuleRoot, module, version string) (Info, error)
- func (g *GitHubProxy) GetInfoRevision(ctx context.Context, moduleRoot *ModuleRoot, module string, ...) (Info, error)
- type Info
- type Module
- type ModuleArchive
- type ModuleCache
- func (c *ModuleCache) Archive(ctx context.Context, module, version string, w io.Writer) error
- func (c *ModuleCache) CachedModFiles(module string) ([]string, error)
- func (c *ModuleCache) CachedModInfos(module string) ([]string, error)
- func (c *ModuleCache) CachedModuleRoots() ([]*ModuleRoot, error)
- func (c *ModuleCache) FlushAll() error
- func (c *ModuleCache) GetModFile(module, version string) ([]byte, error)
- func (c *ModuleCache) GetModInfo(module, sha string) (time.Time, error)
- func (c *ModuleCache) GetModuleRoot(repoRoot string, baseDir string, vcs *VCS) (*ModuleRoot, error)
- func (c *ModuleCache) GetRepoRoot(importPath string) (repoRoot string, repoURL string, err error)
- func (c *ModuleCache) Invalidate(module string) error
- func (c *ModuleCache) Ping() error
- func (c *ModuleCache) SaveArchive(ctx context.Context, module, version string, data []byte) error
- func (c *ModuleCache) SetModFile(module, version string, modFile []byte) error
- func (c *ModuleCache) SetModInfo(module, sha string, t time.Time) error
- func (c *ModuleCache) SetModuleRoot(moduleRoot *ModuleRoot) error
- func (c *ModuleCache) SetRepoRoot(importPath, repoRoot, repoURL string) error
- type ModuleFetcher
- type ModuleProxy
- func (m *ModuleProxy) CachedModuleRoots() ([]*ModuleRoot, error)
- func (m *ModuleProxy) FlushAllCache() error
- func (m *ModuleProxy) GetConfig(module string) *ModuleSetting
- func (m *ModuleProxy) GetGoMod(ctx context.Context, moduleName, version string) (string, error)
- func (m *ModuleProxy) GetInfo(ctx context.Context, moduleName, version string) (Info, error)
- func (m *ModuleProxy) GetLatestVersion(ctx context.Context, module string) (Info, error)
- func (m *ModuleProxy) GetZip(ctx context.Context, w io.Writer, moduleName, version string) error
- func (m *ModuleProxy) InvalidateCache(module string) error
- func (m *ModuleProxy) IsProxy(module string) bool
- func (m *ModuleProxy) IsUpstream(module string) bool
- func (m *ModuleProxy) Ready() bool
- func (m *ModuleProxy) Versions(ctx context.Context, module string) ([]string, error)
- type ModuleRoot
- type ModuleSetting
- type ModuleVersion
- type ProxyServer
- type PseudoVersion
- type VCS
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheMiss = xerrors.Define("gomodule: cache hit miss")
Functions ¶
This section is empty.
Types ¶
type GitHubProxy ¶
type GitHubProxy struct {
// contains filtered or unexported fields
}
func NewGitHubProxy ¶
func NewGitHubProxy(cache *ModuleCache, ghClient *github.Client) *GitHubProxy
func (*GitHubProxy) Archive ¶
func (g *GitHubProxy) Archive(ctx context.Context, w io.Writer, moduleRoot *ModuleRoot, moduleName, version string) error
func (*GitHubProxy) ArchiveRevision ¶
func (g *GitHubProxy) ArchiveRevision(ctx context.Context, w io.Writer, moduleRoot *ModuleRoot, moduleName, version string) error
func (*GitHubProxy) GetGoMod ¶
func (g *GitHubProxy) GetGoMod(ctx context.Context, moduleRoot *ModuleRoot, module *Module, version string) (string, error)
func (*GitHubProxy) GetGoModRevision ¶
func (g *GitHubProxy) GetGoModRevision(ctx context.Context, moduleRoot *ModuleRoot, module *Module, pseudoVersion *PseudoVersion) (string, error)
func (*GitHubProxy) GetInfo ¶
func (g *GitHubProxy) GetInfo(ctx context.Context, moduleRoot *ModuleRoot, module, version string) (Info, error)
func (*GitHubProxy) GetInfoRevision ¶
func (g *GitHubProxy) GetInfoRevision(ctx context.Context, moduleRoot *ModuleRoot, module string, pseudoVersion *PseudoVersion) (Info, error)
type Module ¶
type Module struct { Path string Versions []*ModuleVersion Root string ModFilePath string // contains filtered or unexported fields }
func (*Module) LatestVersion ¶
func (m *Module) LatestVersion(ctx context.Context) (*ModuleVersion, error)
type ModuleArchive ¶
type ModuleArchive struct { ModuleRoot *ModuleRoot Module *Module Version string Revision string // contains filtered or unexported fields }
func NewModuleArchiveFromGitHub ¶
func NewModuleArchiveFromGitHub(ghClient *github.Client, moduleRoot *ModuleRoot, module, version string, commit *github.RepositoryCommit) (*ModuleArchive, error)
type ModuleCache ¶
type ModuleCache struct {
// contains filtered or unexported fields
}
func NewModuleCache ¶
func NewModuleCache(cachePool *client.SinglePool, endpoint, region, bucket, accessKey, secretAccessKey, caCertFile string) *ModuleCache
func (*ModuleCache) CachedModFiles ¶
func (c *ModuleCache) CachedModFiles(module string) ([]string, error)
func (*ModuleCache) CachedModInfos ¶
func (c *ModuleCache) CachedModInfos(module string) ([]string, error)
func (*ModuleCache) CachedModuleRoots ¶
func (c *ModuleCache) CachedModuleRoots() ([]*ModuleRoot, error)
func (*ModuleCache) FlushAll ¶
func (c *ModuleCache) FlushAll() error
func (*ModuleCache) GetModFile ¶
func (c *ModuleCache) GetModFile(module, version string) ([]byte, error)
func (*ModuleCache) GetModInfo ¶
func (c *ModuleCache) GetModInfo(module, sha string) (time.Time, error)
func (*ModuleCache) GetModuleRoot ¶
func (c *ModuleCache) GetModuleRoot(repoRoot string, baseDir string, vcs *VCS) (*ModuleRoot, error)
func (*ModuleCache) GetRepoRoot ¶
func (c *ModuleCache) GetRepoRoot(importPath string) (repoRoot string, repoURL string, err error)
func (*ModuleCache) Invalidate ¶
func (c *ModuleCache) Invalidate(module string) error
func (*ModuleCache) Ping ¶
func (c *ModuleCache) Ping() error
func (*ModuleCache) SaveArchive ¶
func (*ModuleCache) SetModFile ¶
func (c *ModuleCache) SetModFile(module, version string, modFile []byte) error
func (*ModuleCache) SetModInfo ¶
func (c *ModuleCache) SetModInfo(module, sha string, t time.Time) error
func (*ModuleCache) SetModuleRoot ¶
func (c *ModuleCache) SetModuleRoot(moduleRoot *ModuleRoot) error
func (*ModuleCache) SetRepoRoot ¶
func (c *ModuleCache) SetRepoRoot(importPath, repoRoot, repoURL string) error
type ModuleFetcher ¶
type ModuleFetcher struct {
// contains filtered or unexported fields
}
func NewModuleFetcher ¶
func NewModuleFetcher(baseDir string, cache *ModuleCache, tokenProvider *githubutil.TokenProvider, caBundle []byte) *ModuleFetcher
func (*ModuleFetcher) Get ¶
func (f *ModuleFetcher) Get(ctx context.Context, importPath string, setting *ModuleSetting) (*ModuleRoot, error)
type ModuleProxy ¶
type ModuleProxy struct {
// contains filtered or unexported fields
}
func NewModuleProxy ¶
func NewModuleProxy(conf Config, moduleDir string, cache *ModuleCache, ghClient *github.Client, tokenProvider *githubutil.TokenProvider, caBundle []byte) *ModuleProxy
func (*ModuleProxy) CachedModuleRoots ¶
func (m *ModuleProxy) CachedModuleRoots() ([]*ModuleRoot, error)
func (*ModuleProxy) FlushAllCache ¶
func (m *ModuleProxy) FlushAllCache() error
func (*ModuleProxy) GetConfig ¶
func (m *ModuleProxy) GetConfig(module string) *ModuleSetting
func (*ModuleProxy) GetLatestVersion ¶
func (*ModuleProxy) InvalidateCache ¶
func (m *ModuleProxy) InvalidateCache(module string) error
func (*ModuleProxy) IsProxy ¶
func (m *ModuleProxy) IsProxy(module string) bool
func (*ModuleProxy) IsUpstream ¶
func (m *ModuleProxy) IsUpstream(module string) bool
func (*ModuleProxy) Ready ¶
func (m *ModuleProxy) Ready() bool
type ModuleRoot ¶
type ModuleRoot struct { RootPath string RepositoryURL string Modules []*Module IsGitHub bool // contains filtered or unexported fields }
func NewModuleRoot ¶
func NewModuleRoot(ctx context.Context, rootPath string, vcsRepo *VCS, cache *ModuleCache, dir string) (*ModuleRoot, error)
func NewModuleRootFromCache ¶
func NewModuleRootFromCache(rootPath string, modules []*Module, cache *ModuleCache, vcs *VCS, dir string) *ModuleRoot
func (*ModuleRoot) FindModule ¶
func (m *ModuleRoot) FindModule(module string) *Module
func (*ModuleRoot) SetCache ¶
func (m *ModuleRoot) SetCache() error
type ModuleSetting ¶
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewProxyServer ¶
func NewProxyServer(addr string, upstream *url.URL, proxy *ModuleProxy) *ProxyServer
func (*ProxyServer) Start ¶
func (s *ProxyServer) Start() error
type PseudoVersion ¶
func ParsePseudoVersion ¶
func ParsePseudoVersion(version string) (*PseudoVersion, error)
func (*PseudoVersion) String ¶
func (p *PseudoVersion) String() string
Click to show internal directories.
Click to hide internal directories.