initapp

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "NW"

EnvPrefix is the prefix for configuration parameters passed by environment variables. This prefix is followed by an underscore. For example nginx_binary becomes NW_NGINX_BINARY.

Variables

This section is empty.

Functions

func Init

func Init(startPlugins bool, configPath string) *viper.Viper

Init runs all of the needed functions to load the application to its pre-running state.

startPlugins is a flag that indicates if we should run the Start() function on the plugins found. By default it is off so that plugin metadata can be loaded without starting the plugin. If the run command is executed, this flag should be set to true. configPath is the path to the configuration file or directory.

Types

type PluginMetadataError

type PluginMetadataError struct {
	Err error
}

PluginMetadataError indicates that the plugin metadata is missing a required key.

func (*PluginMetadataError) Cause

func (p *PluginMetadataError) Cause() error

Cause returns the cause of the error - the same as the Unwrap() method.

func (*PluginMetadataError) Unwrap

func (p *PluginMetadataError) Unwrap() error

type PluginMetadataKeyMissing

type PluginMetadataKeyMissing struct {
	KeyMissing string
	PluginMetadataError
}

PluginMetadataKeyMissing indicates that the plugin metadata is missing a required key.

func (*PluginMetadataKeyMissing) Error

func (p *PluginMetadataKeyMissing) Error() string

type PluginMetadataMalformedType

type PluginMetadataMalformedType struct {
	KeyName      string
	ExpectedType reflect.Kind
	PluginMetadataError
}

PluginMetadataMalformedType indicates that the plugin metadata was passed the wrong data type.

func (*PluginMetadataMalformedType) Error

Jump to

Keyboard shortcuts

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