connection

package
v0.0.0-...-3574775 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Artistic-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParallelSSHCount int = 5

5 threads seems to be the optimum between connection overhead and command serilaization on a single threaded Ubuntu VM with ~30 users

Functions

This section is empty.

Types

type AWSConnection

type AWSConnection struct {
	Type, Profile string
}

func (*AWSConnection) Fetch

func (a *AWSConnection) Fetch() (keys <-chan data.Key, accounts <-chan data.Account)

func (*AWSConnection) Id

func (a *AWSConnection) Id() data.ID

func (*AWSConnection) String

func (a *AWSConnection) String() string

type Changer

type Changer interface {
	Update(account data.Account, addBindings []data.KeyBindingImpl, removeBindings []data.KeyBindingImpl, keylib data.Fetcher) error
}

type Connection

type Connection interface {
	Fetch() (keys <-chan data.Key, accounts <-chan data.Account)
	Id() data.ID
}

type FileConnection

type FileConnection struct {
	Type string
	Path string
}

func (*FileConnection) Fetch

func (c *FileConnection) Fetch() (keys <-chan data.Key, accounts <-chan data.Account)

func (*FileConnection) Id

func (c *FileConnection) Id() data.ID

func (*FileConnection) String

func (c *FileConnection) String() string

type Remote

type Remote interface {
	RetrieveKeys() []data.Key
}

type SSHHostConnection

type SSHHostConnection struct {
	Type       string
	Connection string
	Sudo       bool `json:",omitempty"`
}

func (*SSHHostConnection) Fetch

func (c *SSHHostConnection) Fetch() (keys <-chan data.Key, accounts <-chan data.Account)

func (*SSHHostConnection) Id

func (c *SSHHostConnection) Id() data.ID

func (*SSHHostConnection) RetrieveKeys

func (remote *SSHHostConnection) RetrieveKeys(cmd *SshCmd) []data.Key

func (*SSHHostConnection) String

func (c *SSHHostConnection) String() string

func (*SSHHostConnection) Update

func (c *SSHHostConnection) Update(account data.Account, addBindings []data.KeyBindingImpl, removeBindings []data.KeyBindingImpl, keylib data.Fetcher) error

type SshCmd

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

func NewSshCmd

func NewSshCmd(host string) (*SshCmd, error)

func (*SshCmd) Close

func (s *SshCmd) Close()

func (*SshCmd) Run

func (s *SshCmd) Run(cmd string) (string, error)

TODO: implement a timeout

Jump to

Keyboard shortcuts

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