git

package
v0.0.0-...-452f874 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DRUPAL_ARCHIVE    = regexp.MustCompile(`https:\/\/ftp.drupal.org\/files\/projects/(.*)\.zip`)
	BITBUCKET_ARCHIVE = regexp.MustCompile(`http(s|):\/\/([\w-\.]+)\/([\w\.\d-]+)\/([\w-\.\d]+)\/get\/([\w]+)\.zip`)
	GITHUB_ARCHIVE    = regexp.MustCompile(`http(s|):\/\/api\.([\w-\.]+)\/repos\/([\w\.\d-]+)\/([\w\.\d-]+)\/zipball\/([\w]+)`)
	GITLAB_ARCHIVE    = regexp.MustCompile(`http(s|):\/\/([\w-\.]+)\/([\w-\.\d]+)\/([\w-\.\d]+)\/repository\/archive.zip\?ref=([\w]+)`)

	GIT_REPOSITORY = regexp.MustCompile(`^(((git|http(s|)):\/\/|git@))([\w-\.]+@|)([\w-\.]+)(\/|:)([\w-\.\/]+?)(\.git|)$`)
	SVN_REPOSITORY = regexp.MustCompile(`(svn:\/\/(.*)|(.*)\.svn\.(.*))`)

	CACHEABLE_REF = regexp.MustCompile(`([\w\d]{40}|[\w\d]+\.[\w\d]+\.[\w\d]+(-[\w\d]+|))`)
	IS_REF        = regexp.MustCompile(`^[a-zA-Z0-9\.\-]{1,40}$`)
)

Functions

func ConfigureApp

func ConfigureApp(config *pkgmirror.Config, l *goapp.Lifecycle)

func ConfigureHttp

func ConfigureHttp(name string, conf *pkgmirror.GitConfig, app *goapp.App)

func GitRewriteArchive

func GitRewriteArchive(publicServer, path string) string

func GitRewriteRepository

func GitRewriteRepository(publicServer, path string) string

func NewGitPat

func NewGitPat(hostname string) goji.Pattern

Types

type GitConfig

type GitConfig struct {
	PublicServer string
	SourceServer string
	Server       string
	DataDir      string
	Binary       string
	Clone        string
}

type GitPat

type GitPat struct {
	Hostname string
	Pattern  *regexp.Regexp
}

func (*GitPat) Match

func (pp *GitPat) Match(ctx context.Context, r *http.Request) context.Context

type GitService

type GitService struct {
	DB        *bolt.DB
	Config    *GitConfig
	Logger    *log.Entry
	Vault     *vault.Vault
	StateChan chan pkgmirror.State
}

func NewGitService

func NewGitService() *GitService

func (*GitService) Clone

func (gs *GitService) Clone(path string) error

func (*GitService) Has

func (gs *GitService) Has(path string) bool

func (*GitService) Init

func (gs *GitService) Init(app *goapp.App) error

func (*GitService) Serve

func (gs *GitService) Serve(state *goapp.GoroutineState) error

func (*GitService) WriteArchive

func (gs *GitService) WriteArchive(w io.Writer, path, ref string) error

Jump to

Keyboard shortcuts

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