Documentation ¶
Index ¶
- Constants
- func ExportFS(fsys fs.ReadDirFS, path string) error
- func GetEnvOrDefault(k, d string) string
- func GetLoggerFromContext(ctx context.Context) (*log.Entry, bool)
- func GetLoggerFromContextOrDefault(ctx context.Context) *log.Entry
- func GetLoggerFromContextOrDiscard(ctx context.Context) *log.Entry
- func GetServiceLogs(input *SSHJournalctlInput, startTime time.Time, stdout, stderr io.Writer) error
- func SetLoggerForContext(ctx context.Context, l *log.Entry) context.Context
- type LoggerContextKeyType
- type SSHForwardCallback
- type SSHForwardInput
- type SSHJournalctlInput
- type SSHKeyPair
- type SSHPortForward
Constants ¶
View Source
const ( DefaultSSHPort = 22 SSHTimeout = 2 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func GetEnvOrDefault ¶
func GetServiceLogs ¶
GetServiceLogs retrieves log entries stored in journal by systemd via ssh.
Types ¶
type LoggerContextKeyType ¶
type LoggerContextKeyType string
const LoggerContextKey LoggerContextKeyType = "TestEnvContextLogger"
type SSHForwardInput ¶
type SSHForwardInput struct { PrivateKey []byte User string Host string Port int LocalPort int RemoteAddress string RemotePort int Callback SSHForwardCallback }
func (*SSHForwardInput) HostAddressPort ¶
func (i *SSHForwardInput) HostAddressPort() string
func (*SSHForwardInput) LocalAddressPort ¶
func (i *SSHForwardInput) LocalAddressPort() string
func (*SSHForwardInput) RemoteAddressPort ¶
func (i *SSHForwardInput) RemoteAddressPort() string
type SSHJournalctlInput ¶
type SSHKeyPair ¶
func GenerateSSHKeyPair ¶
func GenerateSSHKeyPair() (*SSHKeyPair, error)
GenerateSSHKeyPair generates a new SSH key pair.
func LoadOrGenerateAndSaveSSHKeyPair ¶
func LoadOrGenerateAndSaveSSHKeyPair(privKeyFile, pubKeyFile, workDir string) (*SSHKeyPair, error)
Load SSH key-pair if provided, generate and save otherwise.
func (*SSHKeyPair) Load ¶
func (p *SSHKeyPair) Load(privKeyFile, pubKeyFile string) error
Load is responsible for loading the ssh keypair from filesystem into SSHKeyPair.
func (*SSHKeyPair) Save ¶
func (p *SSHKeyPair) Save(privKeyFile, pubKeyFile string) error
Save is responsible for writing the SSHKeyPair to the filesystem.
type SSHPortForward ¶
type SSHPortForward struct {
// contains filtered or unexported fields
}
func NewSSHPortForward ¶
func NewSSHPortForward(input *SSHForwardInput) (*SSHPortForward, error)
func (*SSHPortForward) DialWithTimeout ¶
func (*SSHPortForward) Stop ¶
func (f *SSHPortForward) Stop()
Click to show internal directories.
Click to hide internal directories.