knownhost

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 8 Imported by: 0

README

knownhost

simple golang knownhosts helper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KnownHost

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

func NewKnownHost

func NewKnownHost(opts ...Option) *KnownHost

func (*KnownHost) GetDefaultKnownHostFile

func (k *KnownHost) GetDefaultKnownHostFile() (string, error)

GetDefaultKnownHostFile returns default knownhosts file path

func (*KnownHost) GetKeysForHost

func (k *KnownHost) GetKeysForHost(host string, timeout time.Duration) ([]ssh.PublicKey, error)

func (*KnownHost) ReadLocalHostKeyForHost

func (k *KnownHost) ReadLocalHostKeyForHost(host string) (hostKey ssh.PublicKey, err error)

ReadLocalHostKeyForHost read known host key for specify host

type Option

type Option func(host *KnownHost)

func WithCustomFile

func WithCustomFile(fileName string) Option

func WithDefaultKnownHostsFile

func WithDefaultKnownHostsFile(yes bool) Option

Jump to

Keyboard shortcuts

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