Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHostIfMissing ¶
AddHostIfMissing adds a host to knownhosts file if needed
func BuildRepoPath ¶
BuildRepoPath splits a url path into its components example: https://github.com/owner/project.git will turn into ./github.com/owner/project
func ParsePrivateKey ¶
func ParsePrivateKey(keyPath string) (*ssh2.PublicKeys, error)
ParsePrivateKey reads the private key from given path
Types ¶
type KnownHosts ¶
type KnownHosts struct {
// contains filtered or unexported fields
}
func ParseKnownHosts ¶
func ParseKnownHosts(knownHostsFile string) (*KnownHosts, error)
ParseKnownHosts reads the given known_hosts file and parses the entries If the file doesn't exist, it will be created
func (*KnownHosts) AddHost ¶
func (kh *KnownHosts) AddHost(host KnownHost)
Adds an known host entry to the cached entries
func (*KnownHosts) ContainsHost ¶
func (kh *KnownHosts) ContainsHost(host string) bool
ContainsHost searches all known hosts entries for a host if the host is not found the hashed host is searched for
func (*KnownHosts) SaveKnownHosts ¶
func (kh *KnownHosts) SaveKnownHosts() error
Overwrites existing knownhosts file with all cached entries including the newly added once
Click to show internal directories.
Click to hide internal directories.