Version: v1.0.0 Latest Latest

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

Go to latest
Published: Jun 18, 2015 License: Apache-2.0 Imports: 16 Imported by: 0



Package gitserver provides a smart Git HTTP server that can also set and remove hooks. The server is lightweight (<7M compiled with a ~2M footprint) and can mirror remote repositories in a containerized environment.



View Source
const (
	EnvironmentHelp = `` /* 1299-byte string literal not displayed */



This section is empty.


func RepositoryURL

func RepositoryURL(config *Config, name string, r *http.Request) *url.URL

RepositoryURL creates the public URL for the named git repo. If both config.URL and request are nil, the returned URL will be nil.

func Start

func Start(config *Config) error


type Clone

type Clone struct {
	URL   url.URL
	Hooks map[string]string

Clone is a repository to clone

type Config

type Config struct {
	Home      string
	GitBinary string
	URL       *url.URL

	AllowHooks      bool
	AllowPush       bool
	AllowLazyCreate bool

	HookDirectory string
	MaxHookBytes  int64

	Listen string

	AuthenticatorFn func(http http.Handler) http.Handler

	CleanBeforeClone bool
	InitialClones    map[string]Clone

Config represents the configuration to use for running the server

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default server config.

func NewEnviromentConfig

func NewEnviromentConfig() (*Config, error)

NewEnviromentConfig sets up the initial config from environment variables


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL