repository

package
v0.0.0-...-e22f67b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2013 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package repository contains types and function for git repository interaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneOrPull

func CloneOrPull(u Unit) ([]byte, error)

CloneOrPull runs a git clone or a git pull in a unit of the app.

First it tries to clone, and if the clone fail (meaning that the repository is already cloned), it pulls changes from the bare repository.

func GetPath

func GetPath() (string, error)

GetPath returns the path to the repository where the app code is in its units.

func GetReadOnlyUrl

func GetReadOnlyUrl(app string) string

GetReadOnlyUrl returns the url for communication with git-daemon.

func GetUrl

func GetUrl(app string) string

GetUrl returns the ssh clone-url from an app.

func GitServerUri

func GitServerUri() string
joins the protocol, server and port together and returns.

This functions makes uses of three configurations:

  • git:host
  • git:protocol
  • git:port (optional)

If some of the required configuration is not found, this function panics.

Types

type Unit

type Unit interface {
	GetName() string
	Command(stdout, stderr io.Writer, cmd ...string) error
}

Unit interface represents a unit of execution.

It must provide two methods:

  • GetName: returns the name of the unit.
  • Command: runs a command in the unit.

Whatever that has a name and is able to run commands, is a unit.

Jump to

Keyboard shortcuts

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