config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmbedConfig []byte

Functions

This section is empty.

Types

type Config

type Config struct {
	// Providers represents the providers to be scanned by cloudgrep
	Providers []Provider `yaml:"providers"`
	// Datastore is the datastore to be used
	Datastore Datastore `yaml:"datastore"`
	// Web is the web specs to be used
	Web Web `yaml:"web"`
	// Adding regions as where cli regions override is stored
	Regions []string
	// Adding regions as where cli profiles override is stored
	Profiles []string
}

Config represents all the user-configurable settings for cloudgrep. One such structure is loaded at runtime and is populated through the cli arguments, user-provider config file, or a preset default, with values resolved in that order of precedence. To see the default, please refer to https://github.com/run-x/cloudgrep/blob/main/pkg/config/config.yaml

func GetDefault added in v0.0.10

func GetDefault() (Config, error)

func ReadFile added in v0.1.0

func ReadFile(file string) (Config, error)

func (*Config) Load added in v0.1.0

func (c *Config) Load() error

Load will load the config files making sure that the options override are correct

type Datastore

type Datastore struct {
	// Type is the kind of datastore to be used by cloudgrep (currently only supports SQLite)
	Type string `yaml:"type"`
	// SkipRefresh determines whether to refresh the data (i.e. scan the cloud) on startup.
	SkipRefresh bool `yaml:"skipRefresh"`
	// DataSourceName is the Type-specific data source name or uri for connecting to the desired data source
	DataSourceName string `yaml:"dataSourceName"`
}

Datastore represents the specs cloudgrep uses for creating and/or connecting to the datastore/database used.

type Provider

type Provider struct {
	// Cloud is the type of the cloud provider (currently only AWS is supported)
	Cloud string `yaml:"cloud"`
	// Regions is the list of different regions within the cloud provider to scan
	Regions []string `yaml:"regions"`
	// Profile is the AWS profile to use, if not set use the default profile
	Profile string `yaml:"profile"`
}

Provider represents a cloud provider cloudgrep will scan w/ the current credentials

func (*Provider) String added in v0.0.11

func (p *Provider) String() string

type Web

type Web struct {
	// Host is the host the server is running as
	Host string `yaml:"host"`
	// Port is the port the server is running in
	Port int `yaml:"port"`
	// Prefix is the url prefix the server uses
	Prefix string `yaml:"prefix"`
	// SkipOpen determines whether to automatically open the webui on startup
	SkipOpen bool `yaml:"skipOpen"`
}

Web represents the specs cloudgrep uses for creating the webapp server

Jump to

Keyboard shortcuts

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