run

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigPath added in v1.0.0

func FindConfigPath(configPath string) string

FindConfigPath returns the config path specified or searches for a valid config path. It will return a path by searching in this order:

  1. The given configPath
  2. The environment variable KAPACITOR_CONFIG_PATH
  3. The first non empty kapacitor.conf file in the path: - ~/.kapacitor/ - /etc/kapacitor/

Types

type Command

type Command struct {
	Version string
	Branch  string
	Commit  string

	Closed chan struct{}

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer

	Server *server.Server
	Logger *log.Logger
	// contains filtered or unexported fields
}

Command represents the command executed by "kapacitord run".

func NewCommand

func NewCommand() *Command

NewCommand return a new instance of Command.

func (*Command) Close

func (cmd *Command) Close() error

Close shuts down the server.

func (*Command) ParseConfig

func (cmd *Command) ParseConfig(path string) (*server.Config, error)

ParseConfig parses the config at path. Returns a demo configuration if path is blank.

func (*Command) ParseFlags

func (cmd *Command) ParseFlags(args ...string) (Options, error)

ParseFlags parses the command line flags from args and returns an options set.

func (*Command) Run

func (cmd *Command) Run(args ...string) error

Run parses the config from args and runs the server.

type Options

type Options struct {
	ConfigPath string
	PIDFile    string
	Hostname   string
	CPUProfile string
	MemProfile string
	LogFile    string
	LogLevel   string
}

Options represents the command line options that can be parsed.

type PrintConfigCommand

type PrintConfigCommand struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

PrintConfigCommand represents the command executed by "kapacitord config".

func NewPrintConfigCommand

func NewPrintConfigCommand() *PrintConfigCommand

NewPrintConfigCommand return a new instance of PrintConfigCommand.

func (*PrintConfigCommand) Run

func (cmd *PrintConfigCommand) Run(args ...string) error

Run parses and prints the current config loaded.

Jump to

Keyboard shortcuts

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