git

package
v0.0.0-...-f253465 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBasicAuth

func GetBasicAuth(username, password string) (transport.AuthMethod, error)

func GetSSHKeyAuth

func GetSSHKeyAuth(privateSshKey []byte, insecureIgnoreHostKey bool) (transport.AuthMethod, error)

func GetSSHKeyFileAuth

func GetSSHKeyFileAuth(privateSshKeyFile string, insecureIgnoreHostKey bool) (transport.AuthMethod, error)

Types

type Config

type Config struct {
	RepoURL    string `json:"RepoURL" yaml:"RepoURL"`
	Branch     string `json:"Branch" yaml:"Branch"`
	Username   string `json:"Username" yaml:"Username"`
	Password   string `json:"Password" yaml:"Password"`
	Insecure   bool   `json:"Insecure" yaml:"Insecure"`
	SSHKey     string `json:"SshKey" yaml:"SshKey"`
	SSHKeyFile string `json:"SshKeyFile" yaml:"SshKeyFile"`
}

type GitConnection

type GitConnection struct {
	// contains filtered or unexported fields
}

func NewGitConnection

func NewGitConnection(auth transport.AuthMethod, repoURL string, insecureSkipTLS, insecureIgnoreUnkownHost bool, storer *memory.Storage, fs billy.Filesystem, logger logrus.Entry) *GitConnection

NewGitConnection creates and returns a new git connection

func (*GitConnection) GetBranches

func (gc *GitConnection) GetBranches() ([]string, error)

func (*GitConnection) GetFile

func (gc *GitConnection) GetFile(branch, path string) (billy.File, error)

func (*GitConnection) GetFileContent

func (gc *GitConnection) GetFileContent(branch, path string) ([]byte, error)

func (*GitConnection) GetWorktree

func (gc *GitConnection) GetWorktree(branch string) (*git.Worktree, error)

type GitGateway

type GitGateway struct {
	// contains filtered or unexported fields
}

func NewGitGateway

func NewGitGateway(cfg *Config) (*GitGateway, error)

func (*GitGateway) GetSecret

func (gw *GitGateway) GetSecret(filePath, secretPath string) (string, string, error)

type Reference

type Reference struct {
	Config   *Config
	JSONFile string `json:"JsonFile" yaml:"JsonFile"`
	Path     string `json:"Path" yaml:"Path"`
}

func (*Reference) GetSecret

func (r *Reference) GetSecret() (string, string, error)

Jump to

Keyboard shortcuts

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