command

package
v14.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 8 Imported by: 0

README


stage: Create group: Source Code info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

Overview

This package consists of a set of packages that are responsible for executing a particular command/feature/operation. The full list of features can be viewed here. The commands implement the common interface:

type Command interface {
	Execute(ctx context.Context) error
}

A command is executed by running the Execute method. The execution logic mostly shares the common pattern:

  • Parse the arguments and validate them.
  • Communicate with GitLab Rails using gitlabnet package. For example, it can be checking whether a client is authorized to execute this particular command or asking for a personal access token in order to return it to the client.
  • If a command is related to Git operations, establish a connection with Gitaly using handler and gitaly packages and provide two-way communication between Gitaly and the client.
  • Return results to the client.

This package is being used to build a particular command based on the passed arguments in the following files that are under cmd directory:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForVersionFlag added in v14.24.0

func CheckForVersionFlag(osArgs []string, version, buildTime string)

func Setup

func Setup(serviceName string, config *config.Config) (context.Context, func())

Setup() initializes tracing from the configuration file and generates a background context from which all other contexts in the process should derive from, as it has a service name and initial correlation ID set.

Types

type Command

type Command interface {
	Execute(ctx context.Context) (context.Context, error)
}

type LogData added in v14.27.0

type LogData struct {
	Username     string      `json:"username"`
	WrittenBytes int64       `json:"written_bytes"`
	Meta         LogMetadata `json:"meta"`
}

func NewLogData added in v14.27.0

func NewLogData(project, username string, projectID, rootNamespaceID int) LogData

type LogMetadata added in v14.24.0

type LogMetadata struct {
	Project         string `json:"project,omitempty"`
	RootNamespace   string `json:"root_namespace,omitempty"`
	ProjectID       int    `json:"project_id,omitempty"`
	RootNamespaceID int    `json:"root_namespace_id,omitempty"`
}

Directories

Path Synopsis
Package authorizedkeys handles fetching and printing authorized SSH keys.
Package authorizedkeys handles fetching and printing authorized SSH keys.
Package authorizedprincipals handles printing authorized principals in GitLab Shell.
Package authorizedprincipals handles printing authorized principals in GitLab Shell.
Package commandargs defines structures and methods for handling command-line arguments related to authorized key checks in the GitLab shell.
Package commandargs defines structures and methods for handling command-line arguments related to authorized key checks in the GitLab shell.
Package discover implements the "discover" command for fetching user info and displaying a welcome message.
Package discover implements the "discover" command for fetching user info and displaying a welcome message.
Package gitauditevent handles Git audit events for GitLab.
Package gitauditevent handles Git audit events for GitLab.
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.
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.
Package healthcheck provides functionality to perform health checks.
Package healthcheck provides functionality to perform health checks.
Package lfsauthenticate provides functionality for authenticating Git LFS requests
Package lfsauthenticate provides functionality for authenticating Git LFS requests
Package lfstransfer wraps https://github.com/charmbracelet/git-lfs-transfer logic
Package lfstransfer wraps https://github.com/charmbracelet/git-lfs-transfer logic
Package personalaccesstoken handles operations related to personal access tokens, including parsing arguments, requesting tokens, and formatting responses.
Package personalaccesstoken handles operations related to personal access tokens, including parsing arguments, requesting tokens, and formatting responses.
Package receivepack provides functionality for handling Git receive-pack commands
Package receivepack provides functionality for handling Git receive-pack commands
shared
accessverifier
Package accessverifier handles the verification of access permission.
Package accessverifier handles the verification of access permission.
customaction
Package customaction provides functionality for handling custom actions
Package customaction provides functionality for handling custom actions
disallowedcommand
Package disallowedcommand provides an error for handling disallowed commands.
Package disallowedcommand provides an error for handling disallowed commands.
Package twofactorrecover defines logic for 2FA codes recovery
Package twofactorrecover defines logic for 2FA codes recovery
Package twofactorverify provides functionality for two-factor verification
Package twofactorverify provides functionality for two-factor verification
Package uploadarchive provides functionality for uploading archives
Package uploadarchive provides functionality for uploading archives
Package uploadpack provides functionality for handling upload-pack command
Package uploadpack provides functionality for handling upload-pack command

Jump to

Keyboard shortcuts

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