config

package
v0.0.0-...-4ceb61e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConnectorName = errors.New("invalid connector name")

Functions

func FetchFromSSM

func FetchFromSSM(svc ssmiface.SSMAPI, param string) (*ssm.GetParameterOutput, error)

func SetupSSMField

func SetupSSMField(svc ssmiface.SSMAPI, key string) string

func StartSSMSession

func StartSSMSession(cfg *Config) (ssmiface.SSMAPI, error)

Types

type Config

type Config struct {
	Credentials   Credentials
	Sockets       SocketParams
	Connector     Connector
	AwsGroups     []ConnectorGroups `mapstructure:"aws_groups"`
	DockerPlugin  []ConnectorGroups `mapstructure:"docker_plugin"`
	NetworkPlugin []NetworkPlugin   `mapstructure:"network_plugin"`
	K8Plugin      []K8Plugin        `mapstructure:"k8_plugin"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type ConfigParser

type ConfigParser struct {
}

func NewConfigParser

func NewConfigParser() *ConfigParser

func (*ConfigParser) LoadSSMInConfig

func (c *ConfigParser) LoadSSMInConfig(ssmAPI ssmiface.SSMAPI, cfg *Config) error

func (*ConfigParser) Parse

func (c *ConfigParser) Parse(configPath string) (*Config, error)

type Connector

type Connector struct {
	Name         string
	AwsRegion    string `mapstructure:"aws-region"`
	SSMAwsRegion string `mapstructure:"ssm-aws-region"`
	AwsProfile   string `mapstructure:"aws-profile"`
}

type ConnectorGroups

type ConnectorGroups struct {
	Group                 string
	AllowedEmailAddresses []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains   []string `mapstructure:"allowed_email_domains"`
	PrivateSocket         bool     `mapstructure:"private_socket"`
	Policies              []string `mapstructure:"policies"`
}

type Credentials

type Credentials struct {
	Username string
	User     string
	Password string
	Token    string
}

func (Credentials) GetUsername

func (c Credentials) GetUsername() string

type K8Plugin

type K8Plugin struct {
	Group                 string
	Namespace             string
	AllowedEmailAddresses []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains   []string `mapstructure:"allowed_email_domains"`
	PrivateSocket         bool     `mapstructure:"private_socket"`
	Policies              []string `mapstructure:"policies"`
}

type NetworkPlugin

type NetworkPlugin struct {
	Scan_interval         int64                           `mapstructure:"scan_interval"`
	Group                 string                          `mapstructure:"group"`
	AllowedEmailAddresses []string                        `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains   []string                        `mapstructure:"allowed_email_domains"`
	PrivateSocket         bool                            `mapstructure:"private_socket"`
	Networks              map[string]NetworkPluginNetwork `mapstructure:"networks"`
	Policies              []string                        `mapstructure:"policies"`
}

type NetworkPluginNetwork

type NetworkPluginNetwork struct {
	Interfaces []string `mapstructure:"interfaces"`
	Subnets    []string `mapstructure:"subnets"`
	Ports      []uint16 `mapstructure:"ports"`
}

type SocketConfig

type SocketConfig struct {
	Host                  string
	Port                  int
	Name                  string
	Type                  string
	Description           string
	AllowedEmailAddresses []string `mapstructure:"allowed_email_addresses"`
	AllowedEmailDomains   []string `mapstructure:"allowed_email_domains"`
	UpstreamUser          string   `mapstructure:"upstream_user"`
	UpstreamPassword      string   `mapstructure:"upstream_password"`
	UpstreamType          string   `mapstructure:"upstream_type"`
	PrivateSocket         bool     `mapstructure:"private_socket"`
	DatabaseCredentials   string   `mapstructure:"database_credentials"`
	UpstreamHttpHostname  string   `mapstructure:"upstream_http_hostname"`
	Policies              []string `mapstructure:"policies"`
}

type SocketParams

type SocketParams []map[string]SocketConfig

Jump to

Keyboard shortcuts

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