core

package
v0.0.0-...-9b10dc4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 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 {
	Port       string     // The port to listen on
	Host       string     // The host to listen on
	Yaml       string     // The path to the YAML config file
	YamlConfig YamlConfig // The YAML config
}

The config struct

func InitializeConfig

func InitializeConfig() *Config

Initialize the config

type SSHConfiguration

type SSHConfiguration struct {
	Servers []SSHServerData `yaml:"servers"`
}

The SSH configuration struct

type SSHServerData

type SSHServerData struct {
	Name       string `yaml:"name"`
	Host       string `yaml:"host"`
	User       string `yaml:"user"`
	Password   string `yaml:"password"`
	PrivateKey string `yaml:"path_to_key"`
	Passphrase string `yaml:"passphrase"`
	// Optional
	Port          *uint `yaml:"port"`
	KeepAlive     *bool `yaml:"keep_alive"`
	Retry         *bool `yaml:"retry"`
	RetryCount    *int  `yaml:"retry_count"`
	RetryInterval *int  `yaml:"retry_interval"`
	Timeout       *int  `yaml:"timeout"`
}

The SSH server struct

type WebhookAuthData

type WebhookAuthData struct {
	IPWhitelist  []string          `yaml:"ip_whitelist"`
	IPBlacklist  []string          `yaml:"ip_blacklist"`
	IPFromHeader string            `yaml:"ip_from_header"`
	Headers      map[string]string `yaml:"headers"`
}

The auth struct for the webhook

type WebhookData

type WebhookData struct {
	Path     string          `yaml:"path"`
	SSHName  string          `yaml:"ssh_name"`
	WhiteCMD []string        `yaml:"cmd_whitelist"`
	BlackCMD []string        `yaml:"cmd_blacklist"`
	Auth     WebhookAuthData `yaml:"auth"`
}

The webhook struct

type YamlConfig

type YamlConfig struct {
	SSH      SSHConfiguration `yaml:"ssh"`
	Webhooks []WebhookData    `yaml:"webhooks"`
}

The YAML config struct

func ParseConfig

func ParseConfig(yamlByte []byte) (*YamlConfig, error)

Jump to

Keyboard shortcuts

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