Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { // Loader is used to load repositories. It uses [transport.DefaultLoader] // when nil. Loader transport.Loader // UploadPack indicates whether the handler should handle // git-upload-pack requests. UploadPack bool // ReceivePack indicates whether the handler should handle // git-receive-pack requests. ReceivePack bool }
Backend represents a Git transport server handler that can handle git-upload-pack, git-receive-pack, and git-upload-archive requests over TCP.
func NewBackend ¶
NewBackend creates a new Backend for the given loader. It defaults to enabling both git-upload-pack and git-upload-archive but not git-receive-pack.
func (*Backend) ServeTCP ¶
func (b *Backend) ServeTCP(ctx context.Context, c io.ReadWriteCloser, req *packp.GitProtoRequest)
ServeTCP implements the [Handler] interface for the Backend. TODO: Support idle timeout based on the context. Something like context.WithIdleTimeout where it resets the timer on each read/write operation.
Click to show internal directories.
Click to hide internal directories.