Documentation
¶
Overview ¶
Package git provides an in-process git:// protocol server.
It listens on a TCP port and handles the git:// wire protocol (git-upload-pack, git-receive-pack, git-upload-archive) using the backend.Backend handler. The server supports configurable timeouts and maximum connections, similar to git-daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Loader resolves repository URLs to storage. If nil,
// [transport.DefaultLoader] is used.
Loader transport.Loader
// ErrorLog is used to log errors. If nil, errors are not logged.
ErrorLog *log.Logger
// Timeout is the idle timeout for each connection. If a connection
// has no read or write activity for this duration, it is closed.
// If zero, there is no idle timeout. Corresponds to git-daemon's
// --timeout.
Timeout time.Duration
// InitTimeout is the timeout for the initial protocol handshake
// (reading the GitProtoRequest). If zero, there is no handshake
// timeout. Corresponds to git-daemon's --init-timeout.
InitTimeout time.Duration
// MaxTimeout is the absolute maximum duration a connection is
// allowed to live, regardless of activity. If zero, there is no
// maximum. This is useful to prevent long-lived connections from
// consuming server resources indefinitely.
MaxTimeout time.Duration
// MaxConnections is the maximum number of simultaneous connections.
// If zero, there is no limit. Corresponds to git-daemon's
// --max-connections. Connections beyond the limit are immediately
// closed.
MaxConnections int
// contains filtered or unexported fields
}
Server is a git:// protocol server.
func FromLoader ¶
FromLoader creates a git:// server backed by the given loader.
Click to show internal directories.
Click to hide internal directories.