conf

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SshClient *SshClientConf `yaml:"sshclient"`
	Tunnel    []*TunnnelConf `yaml:"tunnel"`
	SshD      *SshDConf      `yaml:"sshd"`
}

Config holds all the config values

func LoadConfig

func LoadConfig(filePath string) *Config

type JumpHostConf

type JumpHostConf struct {
	// user@server:port
	URI      string `yaml:"uri"`
	Identity string `yaml:"identity"`
}

type SshClientConf

type SshClientConf struct {
	Identity  string `yaml:"identity"`
	ServerURI string `yaml:"server"`
	// it this value is true host keys are not checked
	// against known_hosts file
	Insecure  bool            `yaml:"insecure"`
	JumpHosts []*JumpHostConf `yaml:"jump_hosts"`
}

SshClientConf holds the ssh client configuration

func (*SshClientConf) GetServerEndpoint

func (c *SshClientConf) GetServerEndpoint() *utils.Endpoint

Builds a server endpoint object from the Server string

type SshDConf

type SshDConf struct {
	Key                string `yaml:"server_key"`
	AuthorizedKeysFile string `yaml:"authorized_keys"`
	// The tcp port the sshd server will listen too
	Port string `yaml:"port"`
}

SshDConf holds the sshd configuration

type TunnnelConf

type TunnnelConf struct {
	//// Tunnel conf
	Remote string `yaml:"remote"`
	Local  string `yaml:"local"`
	// indicates if it is a forward or reverse tunnel
	Forward bool `yaml:"forward"`
}

TunnelConf is a struct that holds the tunnel configuration

func (*TunnnelConf) GetLocalEndpoint

func (c *TunnnelConf) GetLocalEndpoint() *utils.Endpoint

Builds a locale endpoint object from the Local string

func (*TunnnelConf) GetRemotEndpoint

func (c *TunnnelConf) GetRemotEndpoint() *utils.Endpoint

Builds a remote endpoint object from the Remote string

Jump to

Keyboard shortcuts

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