Documentation ¶
Overview ¶
Package gitserver provides a read-only smart HTTP Git server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrGit = errors.New("git cannot be run")
ErrGit is returned by New when the git command cannot be run.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a Git server.
func (*Server) AddPath ¶
AddPath adds a file path to the Git server. The path is served as a Git repository with a single commit. It returns the name of the new served repository.
func (*Server) AddRepository ¶
AddRepository adds a repository to the Git server. It returns the name of the new served repository.
func (*Server) Close ¶
Close stops the server and deletes any temporary directory created to store the repositories.
func (*Server) ListenAndServe ¶
ListenAndServe listens on the TCP network address addr and then calls [*GitServer.Serve] to handle requests on incoming connections.
ListenAndServe always returns a non-nil error.