config

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TAG_AWSA  = "awsa"
	TAG_CI    = "ci"
	TAG_LIVE  = "live"
	TAG_NISRA = "nisra"
)

tags refer to dp-cli-config.yml environment tags which put that environment into group types

Variables

This section is empty.

Functions

func Dump

func Dump() ([]byte, error)

Types

type CMD

type CMD struct {
	MongoURL    string   `yaml:"mongo-url"`
	Neo4jURL    string   `yaml:"neo4j-url"`
	MongoDBs    []string `yaml:"mongo-dbs"`
	Hierarchies []string `yaml:"hierarchies"`
	Codelists   []string `yaml:"codelists"`
}

type Config

type Config struct {
	CMD                    CMD           `yaml:"cmd"`
	Environments           []Environment `yaml:"environments"`
	SSHUser                *string       `yaml:"ssh-user"`
	UserName               *string       `yaml:"user-name"`
	IPAddress              *string       `yaml:"ip-address"`
	HttpOnly               *bool         `yaml:"http-only"`
	DPSetupPath            string        `yaml:"dp-setup-path"`
	NisraPath              string        `yaml:"dp-nisra-path"`
	DPCIPath               string        `yaml:"dp-ci-path"`
	DPHierarchyBuilderPath string        `yaml:"dp-hierarchy-builder-path"`
	DPCodeListScriptsPath  string        `yaml:"dp-code-list-scripts-path"`
	DPCLIPath              string        `yaml:"dp-cli-path"`
}

func Get

func Get() (*Config, error)

Get returns the config struct by parsing the YML file

func (Config) GetAnsibleDirectory

func (cfg Config) GetAnsibleDirectory(env Environment) string

func (Config) GetMyIP

func (cfg Config) GetMyIP() (string, error)

GetMyIP fetches your external IP address

func (Config) GetPath

func (cfg Config) GetPath(env Environment) string

func (Config) GetProfile

func (cfg Config) GetProfile(env string) string

func (Config) IsAWSA

func (cfg Config) IsAWSA(env string) bool

func (Config) IsCI

func (cfg Config) IsCI(env string) bool

func (Config) IsLive

func (cfg Config) IsLive(env string) bool

func (Config) IsNisra

func (cfg Config) IsNisra(env string) bool

type Environment

type Environment struct {
	Name       string     `yaml:"name"`
	Profile    string     `yaml:"profile"`
	SSHUser    string     `yaml:"ssh-user"`
	Tags       []string   `yaml:"tags"`
	ExtraPorts ExtraPorts `yaml:"extra-ports"`
}

Environment represents an environment

func (Environment) IsAWSA

func (env Environment) IsAWSA() bool

func (Environment) IsCI

func (env Environment) IsCI() bool

func (Environment) IsLive

func (env Environment) IsLive() bool

func (Environment) IsNisra

func (env Environment) IsNisra() bool

type ExtraPorts

type ExtraPorts struct {
	Bastion    []int64 `yaml:"bastion"`
	Publishing []int64 `yaml:"publishing"`
	Web        []int64 `yaml:"web"`
}

ExtraPorts is a list of ports for the given Security Group

Jump to

Keyboard shortcuts

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