gitcredentials

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureHelper

func ConfigureHelper(binaryPath, userName string, port int) error

func GetHTTPPath added in v0.6.9

func GetHTTPPath(ctx context.Context, params GetHttpPathParameters) (string, error)

GetHTTPPath checks for gits `credential.useHttpPath` setting for a given host+protocol and returns the path component of `GitCredential` if the setting is true

func GetLocalGitConfigPath added in v0.5.20

func GetLocalGitConfigPath(repoPath string) string

GetLocalGitConfigPath resolves the local git config for the specified repository path

func RemoveHelper

func RemoveHelper(userName string) error

func RemoveHelperFromPath

func RemoveHelperFromPath(gitConfigPath string) error

func SetUser

func SetUser(userName string, user *GitUser) error

func SetupGpgGitKey added in v0.5.0

func SetupGpgGitKey(gitSignKey string) error

func ToString

func ToString(credentials *GitCredentials) string

Types

type GetHttpPathParameters added in v0.6.9

type GetHttpPathParameters struct {
	Host        string
	Protocol    string
	CurrentPath string
	Repository  string
}

type GitCredentials

type GitCredentials struct {
	Protocol string `json:"protocol,omitempty"`
	URL      string `json:"url,omitempty"`
	Host     string `json:"host,omitempty"`
	Path     string `json:"path,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

func GetCredentials

func GetCredentials(requestObj *GitCredentials) (*GitCredentials, error)

func Parse

func Parse(raw string) (*GitCredentials, error)

type GitUser

type GitUser struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

func GetUser

func GetUser(userName string) (*GitUser, error)

Jump to

Keyboard shortcuts

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