Thanks to visit codestin.com
Credit goes to pkg.go.dev

git

package
v6.0.0-...-3a68d04 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

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

func NewBackend(loader transport.Loader) *Backend

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.

Jump to

Keyboard shortcuts

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