config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalBackendTypes = []string{"local"}

LocalBackendTypes local backend storage

View Source
var RemoteBackendTypes = []string{"s3", "azblob", "gs"}

RemoteBackendTypes allowed remote storage

StateBackendTypes all state backend storage types

Functions

func Contains

func Contains(arr []string, str string) bool

Contains check if array contains value

func GetAWS

func GetAWS() *aws.Config

GetAWS Return database config

func GetLogger

func GetLogger(mgrName, logPath string) *log.Entry

GetLogger returns a logger for logging manager processes Logs are also persisted to file

func GetProviders

func GetProviders() []string

GetProviders returns list of selected providers

func SetVerboseLogging

func SetVerboseLogging()

SetVerboseLogging sets logging to be in DEBUG mode

func StaticPath

func StaticPath() string

StaticPath returns path to application static folder

Types

type Backend

type Backend struct {
	Type   string
	Path   string
	Bucket string
	Region string
}

type Config

type Config struct {
	Name            string
	Providers       []string
	Timezone        string
	RefreshInterval int32
	LogPath         string
	Verbose         bool

	Database *DatabaseConfig

	Web struct {
		// Authentication Details to login to Reka
		Auth struct {
			Username string
			Password string
		}
	}

	// Exclude block prevents certain resources from been tracked or affected by reka.
	Exclude []*ExcludeRule

	// StateBackend is how state is stored (read & write)
	// State files contain details used for infrastructure resumption and history of
	// infrastructural management
	StateBackend *Backend
	// Rules block define how reka should behave given certain resources. These rules
	// usually target resources based on tags/labels which are attached to the resources
	Rules []*Rule
	// AWS Config
	Aws *aws.Config
	// Gcp configuration
	Gcp Gcp
	// contains filtered or unexported fields
}

Config : The Config values passed to application

func GetConfig

func GetConfig() *Config

GetConfig return the config object

func LoadConfig

func LoadConfig() *Config

LoadConfig load all passed configs and defaults

type DatabaseConfig

type DatabaseConfig struct {
	Type     string
	Name     string
	Host     string
	User     string
	Password string
}

DatabaseConfig Config for Dabatabase

func GetDB

func GetDB() *DatabaseConfig

GetDB Return database config

func (*DatabaseConfig) GetConnectionString

func (db *DatabaseConfig) GetConnectionString() string

GetConnectionString the connection string for database

func (*DatabaseConfig) SqliteDefaultPath

func (db *DatabaseConfig) SqliteDefaultPath() string

SqliteDefaultPath the default database path to use for sqlite

type ExcludeRule

type ExcludeRule struct {
	Name      string
	Region    string
	Tags      map[string]string
	Resources []string
}

type Gcp

type Gcp struct {
	ProjectId string
}

Gcp config stores all gcp related config for a project

type Rule

type Rule struct {
	Name      string
	Condition struct {
		ActiveDuration struct {
			StartTime string
			StopTime  string
			StartDay  string
			StopDay   string
		}
		TerminationPolicy string
		TerminationDate   string
	}
	Resources []string
	Region    string
	Tags      map[string]string
}

func (Rule) String

func (r Rule) String() string

Jump to

Keyboard shortcuts

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