app

package
v0.0.0-...-466853b Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config     Config
	ConfigPath string
	Logger     *log.Logger
	// contains filtered or unexported fields
}

App is the main application. It bootstraps all the components and can be gracefully shutdown.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run all the app components. Can be gracefully shutdown using the provided context.

type Config

type Config struct {
	Debug    bool
	Registry string
	HTTP     struct {
		Port int
	}
	Grpc struct {
		Port int
	}
	Bolt struct {
		Backend bool
	}
	Etcd    clientv3.Config
	Paths   Paths
	Plugins Plugins
}

Config of the application.

type Errors

type Errors []error

Errors contains a list of errors stored during the lifecycle of the App.

func (Errors) Error

func (e Errors) Error() string

type Paths

type Paths struct {
	DataDir   string `toml:"data-dir"`
	PluginDir string `toml:"plugin-dir"`
	SocketDir string `toml:"socket-dir"`
}

Paths contains directory paths needed by the app.

func (*Paths) Create

func (p *Paths) Create() error

Create the DataDir and SocketDir if they don't exist.

type Plugins

type Plugins struct {
	Backends []string
	Config   map[string]toml.Primitive
}

Plugins contains the list of backend and server plugins.

Jump to

Keyboard shortcuts

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