fakegitserver

package
v0.0.0-...-6877637 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitCGIHandler

func GitCGIHandler(gitBinary, gitReposParentDir string) http.Handler

GitCGIHandler returns an http.Handler that is backed by git-http-backend (a CGI executable). git-http-backend is the `git http-backend` subcommand that comes distributed with a default git installation.

func SetupRepoHandler

func SetupRepoHandler(gitReposParentDir string, mux *sync.Mutex) http.Handler

SetupRepoHandler executes a JSON payload of instructions to set up a Git repo.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, timeout time.Duration) *Client

func (*Client) SetupRepo

func (c *Client) SetupRepo(repoSetup RepoSetup) error

SetupRepo sends a POST request with the RepoSetup contents.

type RepoSetup

type RepoSetup struct {
	// Name of the Git repo. It will get a ".git" appended to it and be
	// initialized underneath o.gitReposParentDir.
	Name string `json:"name"`
	// Script to execute. This script runs inside the repo to perform any
	// additional repo setup tasks. This script is executed by /bin/sh.
	Script string `json:"script"`
	// Whether to create the repo at the path (o.gitReposParentDir + name +
	// ".git") even if a file (directory) exists there already. This basically
	// does a 'rm -rf' of the folder first.
	Overwrite bool `json:"overwrite"`
}

Jump to

Keyboard shortcuts

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