git

package
v0.0.0-...-bc0646a Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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]+|))`)
)
View Source
var (
	GIT_PATTTERN_URL = regexp.MustCompile(`\/git\/(.*)\/([\w\d]{40}|(.*))\.zip`)
)

Functions

func GitRewriteArchive

func GitRewriteArchive(config *GitConfig, path string) string

func GitRewriteRepository

func GitRewriteRepository(config *GitConfig, path string) string

func NewGitPat

func NewGitPat() goji.Pattern

Types

type GitConfig

type GitConfig struct {
	Server  string
	Code    []byte
	DataDir string
	Binary  string
}

type GitPat

type GitPat struct {
}

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
}

func NewGitService

func NewGitService() *GitService

func (*GitService) End

func (gs *GitService) End() error

func (*GitService) Init

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

func (*GitService) Serve

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

func (*GitService) SyncRepositories

func (gs *GitService) SyncRepositories(service string, wg sync.WaitGroup)

func (*GitService) SyncServices

func (gs *GitService) SyncServices()

func (*GitService) WriteArchive

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

func (*GitService) WriteFile

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

Jump to

Keyboard shortcuts

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