Documentation ¶
Index ¶
- Constants
- Variables
- func EnsureDefaultBranch(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, ...) error
- func EnsureWithin(reposDir string, repo string) error
- func ReceivePack(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, ...) error
- func RunGit(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, dir string, ...) error
- func UploadArchive(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, ...) error
- func UploadPack(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, ...) error
- func WritePktline(w io.Writer, v ...interface{})
Constants ¶
View Source
const ( ReceivePackBin = "git-receive-pack" UploadPackBin = "git-upload-pack" UploadArchiveBin = "git-upload-archive" )
Git protocol commands.
Variables ¶
View Source
var ( // ErrNotAuthed represents unauthorized access. ErrNotAuthed = errors.New("you are not authorized to do this") // ErrSystemMalfunction represents a general system error returned to clients. ErrSystemMalfunction = errors.New("something went wrong") // ErrInvalidRepo represents an attempt to access a non-existent repo. ErrInvalidRepo = errors.New("invalid repo") // ErrInvalidRequest represents an invalid request. ErrInvalidRequest = errors.New("invalid request") // ErrMaxConnections represents a maximum connection limit being reached. ErrMaxConnections = errors.New("too many connections, try again later") // ErrTimeout is returned when the maximum read timeout is exceeded. ErrTimeout = errors.New("I/O timeout reached") )
Functions ¶
func EnsureDefaultBranch ¶
func EnsureWithin ¶
EnsureWithin ensures the given repo is within the repos directory.
func ReceivePack ¶
func ReceivePack(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, envs ...string) error
ReceivePack runs the git receive-pack protocol against the provided repo.
func RunGit ¶
func RunGit(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, dir string, envs []string, args ...string) error
RunGit runs a git command in the given repo.
func UploadArchive ¶
func UploadArchive(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, envs ...string) error
UploadArchive runs the git upload-archive protocol against the provided repo.
func UploadPack ¶
func UploadPack(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoDir string, envs ...string) error
UploadPack runs the git upload-pack protocol against the provided repo.
func WritePktline ¶
WritePktline encodes and writes a pktline to the given writer.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.