Documentation
¶
Index ¶
- func AddAuthorizedPublicKey(username string, publicKeyFilename string) error
- func GenerateRSAKeyPair(savePrivateFileTo string, savePublicFileTo string) error
- func GetSyscallCredential(username string) (*syscall.Credential, error)
- type Connector
- type Payload
- type SSHConnector
- func (c SSHConnector) CloseConnection(client *ssh.Client)
- func (c SSHConnector) CloseSession(session *ssh.Session) error
- func (c SSHConnector) CombinedOutput(session *ssh.Session, command string) ([]byte, error)
- func (c SSHConnector) NewClient(remoteServer string, clientConfig *ssh.ClientConfig) (*ssh.Client, error)
- func (c SSHConnector) NewSession(client *ssh.Client) (*ssh.Session, error)
- func (c SSHConnector) Run(session *ssh.Session, command string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthorizedPublicKey ¶
AddAuthorizedPublicKey appends the public key in `publicKeyFilename` into the file `.ssh/authorized_keys` within the home directory of `username`.
func GenerateRSAKeyPair ¶
GenerateRSAKeyPair creates RSK key pairs within a given location.
func GetSyscallCredential ¶
func GetSyscallCredential(username string) (*syscall.Credential, error)
GetSyscallCredential returns the `syscall.Credential` structure of the given system `username`.
Types ¶
type Connector ¶
type Connector interface { NewClient(remoteServer string, clientConfig *ssh.ClientConfig) (*ssh.Client, error) NewSession(client *ssh.Client) (*ssh.Session, error) Run(session *ssh.Session, command string) error CombinedOutput(session *ssh.Session, command string) ([]byte, error) CloseSession(session *ssh.Session) error CloseConnection(client *ssh.Client) }
Connector is an interface to be able to mock SSH connections
type Payload ¶
type Payload struct { // // EndPointRadarbase is the endpoint of the radarbase platform. // EndPointRadarbase string `json:"radarbaseURL"` // UserID is the user id the raw data concerns. UserID string `json:"userID"` // SessionID is the experiment session id the raw data concerns. SessionID string `json:"sessionID"` // OutputDir is the filesystem path where the output data is to // be stored. OutputDir string `json:"outputDirectory"` }
Payload is the data structure for the feature extraction payload.
func (Payload) Run ¶
Run executes the feature extraction payload on local host, using the `runas` user credential.
func (Payload) SSHSubmit ¶
func (p Payload) SSHSubmit(username, jobReq, jobQueue, sshHost, privateKeyFile string) (string, error)
SSHSubmit submits jobs via HPC's access node, using SSH. It requires pubkey authentication to be established between server and the remote user account.
type SSHConnector ¶
type SSHConnector struct {
Description string
}
SSHConnector is used tp replace the standard SSH library functions
func (SSHConnector) CloseConnection ¶
func (c SSHConnector) CloseConnection(client *ssh.Client)
CloseConnection makes it possible to mock the closing of a session
func (SSHConnector) CloseSession ¶
func (c SSHConnector) CloseSession(session *ssh.Session) error
CloseSession makes it possible to mock the closing of a session
func (SSHConnector) CombinedOutput ¶
CombinedOutput makes it possible to mock a local CombinedOutput
func (SSHConnector) NewClient ¶
func (c SSHConnector) NewClient(remoteServer string, clientConfig *ssh.ClientConfig) (*ssh.Client, error)
NewClient makes it possible to mock SSH dial
func (SSHConnector) NewSession ¶
NewSession makes it possible to mock a SSH session