Documentation
¶
Overview ¶
Package ssh exists to provide an api to configure and read from an ssh file
brev ssh host file entry format:
Host <workspace-dns-name> Hostname 0.0.0.0 IdentityFile /home//.brev/brev.pem User brev Port <some-available-port>
also think that file stuff should probably live in files package TODO migrate to using dns name for hostname
Index ¶
- func MakeSSHEntry(workspaceIdentifier entity.WorkspaceLocalID, port string, ...) (string, error)
- type BrevHostValuesSet
- type BrevPorts
- type IdentityPortMap
- type JetBrainsGatewayConfig
- func (jbgc *JetBrainsGatewayConfig) GetBrevHostValueSet() BrevHostValuesSet
- func (jbgc *JetBrainsGatewayConfig) GetBrevPorts() (BrevPorts, error)
- func (jbgc *JetBrainsGatewayConfig) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
- func (jbgc *JetBrainsGatewayConfig) Sync(identifierPortMapping IdentityPortMap) error
- type JetBrainsGatewayConfigStore
- type JetbrainsGatewayConfigXML
- type JetbrainsGatewayConfigXMLComponent
- type JetbrainsGatewayConfigXMLConfigs
- type JetbrainsGatewayConfigXMLSSHConfig
- type JetbrainsGatewayConfigXMLSSHOption
- type Reader
- type SSHConfig
- func (s SSHConfig) GetBrevHostValueSet() BrevHostValuesSet
- func (s SSHConfig) GetBrevHostValues() []entity.WorkspaceLocalID
- func (s SSHConfig) GetBrevPorts() (BrevPorts, error)
- func (s SSHConfig) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
- func (s SSHConfig) GetPrivateKeyFilePath() string
- func (s *SSHConfig) PruneInactiveWorkspaces(identityPortMap IdentityPortMap) error
- func (s *SSHConfig) Sync(identifierPortMapping IdentityPortMap) error
- func (s *SSHConfig) WritePrivateKey(pem string) error
- type SSHConfigurer
- func (sshConfigurer *SSHConfigurer) GetActiveWorkspaceIdentifiers() []entity.WorkspaceLocalID
- func (sshConfigurer SSHConfigurer) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
- func (sshConfigurer *SSHConfigurer) GetIdentityPortMap() (IdentityPortMap, error)
- func (sshConfigurer *SSHConfigurer) Sync() error
- type SSHStore
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeSSHEntry ¶
Types ¶
type BrevHostValuesSet ¶
type BrevHostValuesSet map[entity.WorkspaceLocalID]bool
type IdentityPortMap ¶
type IdentityPortMap map[entity.WorkspaceLocalID]string
type JetBrainsGatewayConfig ¶
func NewJetBrainsGatewayConfig ¶
func NewJetBrainsGatewayConfig(store JetBrainsGatewayConfigStore) (*JetBrainsGatewayConfig, error)
func (*JetBrainsGatewayConfig) GetBrevHostValueSet ¶
func (jbgc *JetBrainsGatewayConfig) GetBrevHostValueSet() BrevHostValuesSet
func (*JetBrainsGatewayConfig) GetBrevPorts ¶
func (jbgc *JetBrainsGatewayConfig) GetBrevPorts() (BrevPorts, error)
func (*JetBrainsGatewayConfig) GetConfiguredWorkspacePort ¶
func (jbgc *JetBrainsGatewayConfig) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
func (*JetBrainsGatewayConfig) Sync ¶
func (jbgc *JetBrainsGatewayConfig) Sync(identifierPortMapping IdentityPortMap) error
type JetbrainsGatewayConfigXML ¶
type JetbrainsGatewayConfigXML struct {
XMLName xml.Name `xml:"application"`
Component JetbrainsGatewayConfigXMLComponent `xml:"component"`
}
type JetbrainsGatewayConfigXMLComponent ¶
type JetbrainsGatewayConfigXMLComponent struct {
Configs JetbrainsGatewayConfigXMLConfigs `xml:"configs"`
Name string `xml:"name,attr,omitempty"`
}
type JetbrainsGatewayConfigXMLConfigs ¶
type JetbrainsGatewayConfigXMLConfigs struct {
SSHConfigs []JetbrainsGatewayConfigXMLSSHConfig `xml:"sshConfig"`
}
type JetbrainsGatewayConfigXMLSSHConfig ¶
type JetbrainsGatewayConfigXMLSSHConfig struct {
ID string `xml:"id,attr,omitempty"`
CustomName entity.WorkspaceLocalID `xml:"customName,attr,omitempty"`
NameFormat string `xml:"nameFormat,attr,omitempty"`
UseOpenSSHConfig string `xml:"useOpenSSHConfig,attr,omitempty"`
Host string `xml:"host,attr,omitempty"`
Port string `xml:"port,attr,omitempty"`
KeyPath string `xml:"keyPath,attr,omitempty"`
Username string `xml:"username,attr,omitempty"`
Options []JetbrainsGatewayConfigXMLSSHOption `xml:"option,omitempty"`
}
type Reader ¶
type Reader interface {
GetBrevPorts() (BrevPorts, error)
GetBrevHostValueSet() BrevHostValuesSet
GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
GetPrivateKeyFilePath() string
}
type SSHConfig ¶
type SSHConfig struct {
// contains filtered or unexported fields
}
func NewSSHConfig ¶
func (SSHConfig) GetBrevHostValueSet ¶
func (s SSHConfig) GetBrevHostValueSet() BrevHostValuesSet
func (SSHConfig) GetBrevHostValues ¶
func (s SSHConfig) GetBrevHostValues() []entity.WorkspaceLocalID
Hostname is a loaded term so using values
func (SSHConfig) GetBrevPorts ¶
func (SSHConfig) GetConfiguredWorkspacePort ¶
func (s SSHConfig) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
func (SSHConfig) GetPrivateKeyFilePath ¶
func (*SSHConfig) PruneInactiveWorkspaces ¶
func (s *SSHConfig) PruneInactiveWorkspaces(identityPortMap IdentityPortMap) error
func (*SSHConfig) Sync ¶
func (s *SSHConfig) Sync(identifierPortMapping IdentityPortMap) error
func (*SSHConfig) WritePrivateKey ¶
type SSHConfigurer ¶
type SSHConfigurer struct {
Reader
Writer
Writers []Writer
// contains filtered or unexported fields
}
func NewSSHConfigurer ¶
func NewSSHConfigurer(workspaces []entity.WorkspaceWithMeta, reader Reader, writer Writer, writers []Writer, privateKey string) *SSHConfigurer
func (*SSHConfigurer) GetActiveWorkspaceIdentifiers ¶
func (sshConfigurer *SSHConfigurer) GetActiveWorkspaceIdentifiers() []entity.WorkspaceLocalID
func (SSHConfigurer) GetConfiguredWorkspacePort ¶
func (sshConfigurer SSHConfigurer) GetConfiguredWorkspacePort(workspaceIdentifier entity.WorkspaceLocalID) (string, error)
func (*SSHConfigurer) GetIdentityPortMap ¶
func (sshConfigurer *SSHConfigurer) GetIdentityPortMap() (IdentityPortMap, error)
func (*SSHConfigurer) Sync ¶
func (sshConfigurer *SSHConfigurer) Sync() error
Click to show internal directories.
Click to hide internal directories.