nodes

package
v0.0.0-...-351f9be Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The json/yaml config key for the config of nodes of outside cloud provider e.g. linode or ec2
	ExternalNodeConfigConfigurationFileKey = "externalNodes"
	SSHPathConfigurationKey                = "sshPath"
)

Variables

This section is empty.

Functions

func GetSSHKey

func GetSSHKey(sshKeyname string) ([]byte, error)

GetSSHKey reads in the ssh file from the .ssh directory, returns the key in []byte format

Types

type ExternalNodeConfig

type ExternalNodeConfig struct {
	Nodes map[int][]*Node `json:"nodes" yaml:"nodes"`
}

ExternalNodeConfig is a struct that is a collection of the node configurations

type Node

type Node struct {
	NodeID           string `json:"nodeID" yaml:"nodeID"`
	PublicIPAddress  string `json:"publicIPAddress" yaml:"publicIPAddress"`
	PrivateIPAddress string `json:"privateIPAddress" yaml:"privateIPAddress"`
	SSHUser          string `json:"sshUser" yaml:"sshUser"`
	SSHKeyName       string `json:"sshKeyName" yaml:"sshKeyName"`
	SSHKey           []byte
}

Node is a configuration of node that is from an outside cloud provider

func (*Node) ExecuteCommand

func (n *Node) ExecuteCommand(command string) (string, error)

ExecuteCommand executes `command` in the specific node created.

func (*Node) SCPFileToNode

func (n *Node) SCPFileToNode(localPath, remotePath string) error

SCPFileToNode copies a file from the local machine to the specific node created.

type SSHPath

type SSHPath struct {
	SSHPath string `json:"sshPath" yaml:"sshPath"`
}

SSHPath is the path to the ssh key used in external node functionality. This be used if the ssh keys exists in a location not in /.ssh

func GetSSHPath

func GetSSHPath() *SSHPath

GetSSHPath gets ssh path from the config

Jump to

Keyboard shortcuts

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