Documentation
¶
Index ¶
Constants ¶
View Source
const ContentTypeGitArchive = "gitarchive"
View Source
const EmptyGitCommitRef = GitCommitRef("")
View Source
const InvalidGitCommitRef = GitCommitRef("")
Variables ¶
View Source
var ( ErrRepositoryAlreadyExists = jobs.SimpleError{jobs.ResponseAlreadyExists, "A repository with this identifier already exists."} ErrSubscribeToUnit = jobs.SimpleError{jobs.ResponseError, "Unable to watch for the completion of this action."} ErrRepositoryCreateFailed = jobs.SimpleError{jobs.ResponseError, "Unable to create the repository."} )
View Source
var SliceGitTemplate = template.Must(template.New("githost.slice").Parse(`[Unit]
Description=Git Host slice
[Slice]
CPUAccounting=yes
MemoryAccounting=yes
MemoryLimit=512M
Slice=user.slice
[Install]
WantedBy=user.service`))
View Source
var UnitGitHostTemplate = template.Must(template.New("githost.service").Parse(`[Unit]
Description=Git host
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
Slice=githost.slice
ExecStartPre=- /bin/sh -c '/usr/bin/docker inspect -format="Removing old geard-githost" "geard-githost" 2>/dev/null && /usr/bin/docker rm "geard-githost"'
ExecStart=/usr/bin/docker run --name "geard-githost" -v /var/lib/containers/git:/var/lib/containers/git:rw -v /etc:/host_etc:ro -a stdout -a stderr --rm "ccoleman/geard-githost"
ExecStop=/usr/bin/docker stop "geard-githost"
Restart=on-failure`))
Functions ¶
func InitializeRepository ¶
func InitializeRepository(repositoryId git.RepoIdentifier, repositoryURL string) error
func InitializeServices ¶
func InitializeServices() error
func NewGitExtension ¶
func NewGitExtension() jobs.JobExtension
Return a job extension that casts requests directly to jobs TODO: Move implementation out of request object and into a
specific package
Types ¶
type CreateRepositoryRequest ¶
type CreateRepositoryRequest struct { Id git.RepoIdentifier CloneUrl string RequestId jobs.RequestIdentifier }
func (CreateRepositoryRequest) Execute ¶
func (j CreateRepositoryRequest) Execute(resp jobs.Response)
type GitArchiveContentRequest ¶
type GitArchiveContentRequest struct { RepositoryId git.RepoIdentifier Ref GitCommitRef }
func (GitArchiveContentRequest) Execute ¶
func (j GitArchiveContentRequest) Execute(resp jobs.Response)
type GitCommitRef ¶
type GitCommitRef string
func NewGitCommitRef ¶
func NewGitCommitRef(s string) (GitCommitRef, error)
Click to show internal directories.
Click to hide internal directories.