cli

package
v0.0.0-...-ec14ce0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: Apache-2.0 Imports: 26 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 {
	sync.RWMutex
	// contains filtered or unexported fields
}

App application root.

func NewApp

func NewApp(opts ...Option) *App

NewApp creates a new App instance.

func (*App) Creds

Creds a kludge to ease integration testing. TODO: (screwyprof) read keys on client side.

func (*App) Init

func (a *App) Init() error

Init initialize the application.

func (*App) PublicKey

func (a *App) PublicKey() ecdsa.PublicKey

PublicKey used in integration tests.

func (*App) Run

func (a *App) Run() error

Run runs the application.

func (*App) Stop

func (a *App) Stop()

Stop gracefully stops the application.

type Config

type Config struct {
	CfgPath string

	ListenAddr string `yaml:"address"`
	DataDir    string `yaml:"data_dir" required:"true" default:"./data"`

	LogLevel string `yaml:"log_level" required:"true" default:"DEBUG"`

	EthCfg accounts.EthConfig `yaml:"ethereum" required:"true"`

	OrdersCleanUpPeriod string `yaml:"orders_cleanup_period" required:"true" default:"1m"`
	OrdersTTL           string `yaml:"orders_ttl" required:"true" default:"5m"`
}

Config application configuration object.

func NewConfig

func NewConfig(opts ...Option) *Config

NewConfig instantiates Config.

func (*Config) FromFile

func (c *Config) FromFile(filePath string) error

FromFile loads options from file.

func (*Config) WithOptions

func (c *Config) WithOptions(opts ...Option)

WithOptions sets the given options.

type Option

type Option func(f *Config)

Option is a configuration parameter.

func WithConfigPath

func WithConfigPath(path string) Option

WithConfigPath sets the path to config file to load options from.

func WithDataDir

func WithDataDir(dirPath string) Option

WithDataDir sets the database path.

func WithListenAddr

func WithListenAddr(addr string) Option

WithListenAddr sets listen address.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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