githttp

package
v14.56.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package githttp provides functionality to handle Git operations over HTTP(S) and SSH, including executing Git commands like git-upload-pack and converting responses to the expected format for SSH protocols. It integrates with GitLab's internal components for secure access verification and data transfer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellsCommand added in v14.56.0

type CellsCommand struct {
	Config     *config.Config
	ReadWriter *readwriter.ReadWriter
	Args       *commandargs.Shell
	Response   *accessverifier.Response

	Operation string
	RequestFn func(client *git.Client) sshRequestFunc
}

CellsCommand handles git pull/push via SSH-over-HTTP for Cells routing. When the Topology Service routes to a different Cell, Gitaly is not directly reachable, so we proxy SSH pack data through the Cell's Workhorse via POST /{repo}.git/ssh-upload-pack or /ssh-receive-pack.

func NewCellsPullCommand added in v14.56.0

func NewCellsPullCommand(cfg *config.Config, rw *readwriter.ReadWriter, args *commandargs.Shell, resp *accessverifier.Response) *CellsCommand

NewCellsPullCommand builds a Cells SSH-over-HTTP upload-pack command.

func NewCellsPushCommand added in v14.56.0

func NewCellsPushCommand(cfg *config.Config, rw *readwriter.ReadWriter, args *commandargs.Shell, resp *accessverifier.Response) *CellsCommand

NewCellsPushCommand builds a Cells SSH-over-HTTP receive-pack command.

func (*CellsCommand) Execute added in v14.56.0

func (c *CellsCommand) Execute(ctx context.Context) error

Execute runs the Cells SSH-over-HTTP operation.

type PullCommand added in v14.28.0

type PullCommand struct {
	Config     *config.Config
	ReadWriter *readwriter.ReadWriter
	Args       *commandargs.Shell
	Response   *accessverifier.Response
}

PullCommand handles the execution of a Git pull operation over HTTP(S) or SSH

func (*PullCommand) Execute added in v14.28.0

func (c *PullCommand) Execute(ctx context.Context) error

Execute runs the pull command by determining the appropriate method (HTTP/SSH)

func (*PullCommand) ForInfoRefs added in v14.40.0

func (c *PullCommand) ForInfoRefs() (*readwriter.ReadWriter, string, []byte)

ForInfoRefs returns the necessary Pull specifics for client.InfoRefs()

type PushCommand

type PushCommand struct {
	Config     *config.Config
	ReadWriter *readwriter.ReadWriter
	Response   *accessverifier.Response
	Args       *commandargs.Shell
}

PushCommand handles the execution of a Git push operation, including configuration, input/output handling, and access verification.

func (*PushCommand) Execute

func (c *PushCommand) Execute(ctx context.Context) error

Execute runs the push command by determining the appropriate method (HTTP/SSH)

func (*PushCommand) ForInfoRefs added in v14.40.0

func (c *PushCommand) ForInfoRefs() (*readwriter.ReadWriter, string, []byte)

ForInfoRefs returns the necessary Push specifics for client.InfoRefs()

Jump to

Keyboard shortcuts

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