git

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 EnsureDefaultBranch(ctx context.Context, in io.Reader, out io.Writer, er io.Writer, repoPath string) error

func EnsureWithin

func EnsureWithin(reposDir string, repo string) error

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

func WritePktline(w io.Writer, v ...interface{})

WritePktline encodes and writes a pktline to the given writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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