smudge

package
v15.11.13 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DriverTypeFilter indicates that the smudge filter is to be run once per object. This is
	// the current default but will be phased out eventually in favor of DriverTypeProcess.
	DriverTypeFilter = DriverType(0)
	// DriverTypeProcess is a long-running smudge filter that can process multiple objects in
	// one session. See gitattributes(5), "Long Running Filter Process".
	DriverTypeProcess = DriverType(1)
)
View Source
const ConfigEnvironmentKey = "GITALY_LFS_SMUDGE_CONFIG"

ConfigEnvironmentKey is the key that gitaly-lfs-smudge expects the configuration to exist at. The value of this environment variable should be the JSON-encoded `Config` struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// GlRepository is the GitLab repository identifier that is required so that we can query
	// the corresponding Rails' repository for the respective LFS contents.
	GlRepository string `json:"gl_repository"`
	// Gitlab contains configuration so that we can connect to Rails in order to retrieve LFS
	// contents.
	Gitlab config.Gitlab `json:"gitlab"`
	// TLS contains configuration for setting up a TLS-encrypted connection to Rails.
	TLS config.TLS `json:"tls"`
	// DriverType is the type of the smudge driver that should be used.
	DriverType DriverType `json:"driver_type"`
}

Config is the configuration used to run gitaly-lfs-smudge. It must be injected via environment variables.

func ConfigFromEnvironment

func ConfigFromEnvironment(environment []string) (Config, error)

ConfigFromEnvironment loads the Config structure from the set of given environment variables.

func (Config) Environment

func (c Config) Environment() (string, error)

Environment encodes the given configuration as an environment variable that can be injected into `gitaly-lfs-smudge`.

func (Config) GitConfiguration

func (c Config) GitConfiguration(cfg config.Cfg) (git.ConfigPair, error)

GitConfiguration returns the Git configuration required to run the smudge filter.

type DriverType

type DriverType int

DriverType determines the type of the smudge filter.

Jump to

Keyboard shortcuts

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