managed

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTransportOptions

func AddTransportOptions(targetUrl string, opts TransportOptions)

func EffectiveURL

func EffectiveURL(targetUrl string) string

EffectiveURL returns the effective URL for requests.

Given that TransportOptions can allow for the target URL to be overriden this returns the same input if Managed Transport is disabled or if no TargetURL is set on TransportOptions.

func Enabled

func Enabled() bool

Enabled defines whether the use of Managed Transport should be enabled. This is only affects git operations that uses libgit2 implementation.

True is returned when the environment variable `EXPERIMENTAL_GIT_TRANSPORT` is detected with the value of `true` or `1`.

func InitManagedTransport

func InitManagedTransport(log logr.Logger) error

InitManagedTransport initialises HTTP(S) and SSH managed transport for git2go, and therefore only impact git operations using the libgit2 implementation.

This must run after git2go.init takes place, hence this is not executed within a init(). Regardless of the state in libgit2/git2go, this will replace the built-in transports.

This function will only register managed transports once, subsequent calls leads to no-op.

func RemoveTransportOptions

func RemoveTransportOptions(targetUrl string)

Types

type TransportOptions

type TransportOptions struct {
	TargetURL string
	CABundle  []byte
}

TransportOptions represents options to be applied at transport-level at request time.

Jump to

Keyboard shortcuts

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