config

package
v0.0.0-...-2bbe97e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutput

func NewOutput(cfg *Config) *out.Output

NewOutput will create a new output container that will hold the text to render

Types

type Config

type Config struct {
	IO          *IO
	OutputType  string
	ConfigDir   string
	Output      *out.Output
	ExitCode    int
	Initialized bool
	Docker
	// contains filtered or unexported fields
}

Config is the main config struct for the app. All needed access handlers are defined here

func (*Config) CloseDatabase

func (c *Config) CloseDatabase() error

CloseDatabase will close the database if it is owned by the config

func (*Config) OpenDatabase

func (c *Config) OpenDatabase() (*bolt.DB, error)

OpenDatabase will open a connection to the database if not done yet and will return it

func (*Config) WithDatabase

func (c *Config) WithDatabase(database *bolt.DB) *Config

WithDatabase will create a new config with the given database and returns a new config

type Database

type Database struct {
	DB *bolt.DB
}

Database is a simple struct that contains a bolt database. Used if only a db is required instead of the whole config.

type Docker

type Docker struct {
	Docker docker.Client
}

Docker is a simple struct that contains the docker client Used if only a docker client is required instead of the whole config

type IO

type IO struct {
	Out io.Writer
	Err io.Writer
	In  io.Reader
}

IO is a struct that abstracts away the In/Outputs for the app.

Jump to

Keyboard shortcuts

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