config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CLIVersion             string
	ManifestsRepositoryTag string
	CoreImageTag           string
	CoreUIImageTag         string
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiVersion string     `yaml:"apiVersion"`
	Kind       string     `yaml:"kind"`
	Spec       ConfigSpec `yaml:"spec"`
}

func FromFile

func FromFile(path string) (config *Config, err error)

func (*Config) AddComponent

func (c *Config) AddComponent(name string)

func (*Config) AddOverlay

func (c *Config) AddOverlay(name string)

func (*Config) GetOverlayComponent

func (c *Config) GetOverlayComponent(overlayComponentGet string) []*SimpleOverlayedComponent

overlayComponent is form of "common/application/base"

func (*Config) GetOverlayComponents

func (c *Config) GetOverlayComponents(skipOverlayComponent string) []*SimpleOverlayedComponent

func (*Config) Validate

func (c *Config) Validate() error

Checks the config to make sure all the set files exist, etc. Errors are returned in a human friendly format, and can be printed to stdout.

type ConfigSpec

type ConfigSpec struct {
	ManifestsRepo string   `yaml:"manifestsRepo"`
	Params        string   `yaml:"params"`
	Components    []string `yaml:"components"`
	Overlays      []string `yaml:"overlays"`
}

func (*ConfigSpec) HasComponent added in v1.0.0

func (c *ConfigSpec) HasComponent(name string) bool

HasComponent checks if the config spec has any component with the exact name given

func (*ConfigSpec) HasLikeComponent added in v1.0.0

func (c *ConfigSpec) HasLikeComponent(name string) bool

HasLikeComponent checks if the config spec has any component that starts with the name given

type Database added in v1.0.0

type Database struct {
	Host         *ManifestVar
	Username     *ManifestVar
	Password     *ManifestVar
	Port         *ManifestVar
	DatabaseName *ManifestVar `yaml:"databaseName"`
	DriverName   *ManifestVar `yaml:"driverName"`
}

Database represents the configuration available for the database

type DatabaseWrapper added in v1.0.0

type DatabaseWrapper struct {
	Database *Database `yaml:"database"`
}

DatabaseWrapper is a utility for loading the database key from yaml

type ManifestVar added in v1.0.0

type ManifestVar struct {
	Required bool   `yaml:"required"`
	Value    string `yaml:"default"`
}

ManifestVar represents a variable from the manifest

func RequiredManifestVar added in v1.0.0

func RequiredManifestVar(val string) *ManifestVar

RequiredManifestVar returns a ManifestVar that is required with the input value

type SimpleOverlayedComponent

type SimpleOverlayedComponent struct {
	// contains filtered or unexported fields
}

func CreateSimpleOverlayedComponent

func CreateSimpleOverlayedComponent(names ...string) *SimpleOverlayedComponent

func (*SimpleOverlayedComponent) AddPart

func (s *SimpleOverlayedComponent) AddPart(name *string)

func (*SimpleOverlayedComponent) PartsSkipFirst

func (s *SimpleOverlayedComponent) PartsSkipFirst() []*string

If there is one part, return just that part. If there is more than one, return all but the first.

Jump to

Keyboard shortcuts

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