Documentation ¶
Overview ¶
Package wishlist provides a library and binary to list and connect to SSH apps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Listen string `yaml:"listen"` // Address to listen on. Port int64 `yaml:"port"` // Port to start the first server on. Endpoints []*Endpoint `yaml:"endpoints"` // Endpoints to list. Factory func(Endpoint) (*ssh.Server, error) `yaml:"-"` // Factory used to create the SSH server for the given endpoint. Users []User `yaml:"users"` // Users allowed to access the list. EndpointChan chan []*Endpoint `yaml:"-"` // Channel to update the endpoints. Used only in server mode. // contains filtered or unexported fields }
Config represents the wishlist configuration.
type Endpoint ¶
type Endpoint struct { Name string `yaml:"name"` // Endpoint name. Address string `yaml:"address"` // Endpoint address in the `host:port` format, if empty, will be the same address as the list, increasing the port number. User string `yaml:"user"` // User to authenticate as. ForwardAgent bool `yaml:"forward_agent"` // ForwardAgent defines wether to forward the current agent. Anologous to SSH's config ForwardAgent. RequestTTY bool `yaml:"request_tty"` // RequestTTY defines wether to request a TTY. Anologous to SSH's config RequestTTY. RemoteCommand string `yaml:"remote_command"` // RemoteCommand defines wether to request a TTY. Anologous to SSH's config RemoteCommand. IdentityFiles []string `yaml:"-"` // IdentityFiles is only set when parsing from a SSH Config file, and used only on local mode. Middlewares []wish.Middleware `yaml:"-"` // wish middlewares you can use in the factory method. }
Endpoint represents an endpoint to list. If it has a Handler, wishlist will start an SSH server on the given address.
func (*Endpoint) Description ¶
Description to abide the list.Item interface.
func (*Endpoint) FilterValue ¶
FilterValue to abide the list.Item interface.
func (Endpoint) ShouldListen ¶
ShouldListen returns true if we should start a server for this endpoint.
type ListModel ¶ added in v0.4.0
type ListModel struct {
// contains filtered or unexported fields
}
ListModel main wishlist model.
func NewListing ¶ added in v0.4.0
NewListing creates a new listing model for the given endpoints and SSH session. If sessuion is nil, it is assume to be a local listing.
type SSHClient ¶ added in v0.2.0
type SSHClient interface {
For(e *Endpoint) tea.ExecCommand
}
SSHClient is a SSH client.
func NewLocalSSHClient ¶ added in v0.2.0
func NewLocalSSHClient() SSHClient
NewLocalSSHClient returns a SSH Client for local usage.
type SetEndpointsMsg ¶ added in v0.5.0
type SetEndpointsMsg struct {
Endpoints []*Endpoint
}
SetEndpointsMsg can be used to update the listed wishlist endpoints.