cmd

package
v0.0.0-...-d1992f0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatasourceNotLoaded = errors.New("could not load configuration: no database source specified")

ErrDatasourceNotLoaded is returned when the datasource variable in the configuration file is not loaded properly

Functions

func App

func App(appVersion string) *cli.App

App func init

func RegisterCommand

func RegisterCommand(name string, factory CommandFactory) error

RegisterCommand adds a new command factory that will be used to build cli commands and returns error if factory is nil or command has always been registered

Types

type CommandFactory

type CommandFactory func() cli.Command

CommandFactory func init

type Config

type Config struct {
	Database datastore.BackendConfig
	API      *api.Config
}

Config is the global configuration for an instance of Port Authority

func DefaultConfig

func DefaultConfig() Config

DefaultConfig is a configuration that can be used as a fallback value

func LoadConfig

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

LoadConfig is a shortcut to open a file, read it, and generate a Config. It supports relative and absolute paths. Given "", it returns DefaultConfig.

type File

type File struct {
	PortAuthority Config `yaml:"portauthority"`
}

File represents a YAML configuration file that namespaces all Port Authority configuration under the top-level "portauthority" key

Jump to

Keyboard shortcuts

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