system

package
v0.0.0-...-f810e02 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name, Version, Revision string
	ConfigFilePath          string
	SchemaFilePath          string
	Debug, Verbose          bool
	InReader                io.Reader
	OutWriter, ErrWriter    io.Writer
	// contains filtered or unexported fields
}

Config stores general setting params and provides accessors for them.

func NewConfig

func NewConfig(
	name, version, revision string,
	inReader io.Reader,
	outWriter, errWriter io.Writer,
) *Config

NewConfig creates new Config object.

func (*Config) GetDefaultConfigName

func (c *Config) GetDefaultConfigName() string

GetDefaultConfigName returns a default config file name

func (*Config) GetDefaultSchemaName

func (c *Config) GetDefaultSchemaName() string

GetDefaultSchemaName returns a default schema file path

func (*Config) GetDgraphURL

func (c *Config) GetDgraphURL() string

GetDgraphURL returns the URL for the target Dgraph.

func (*Config) GetSchemaPath

func (c *Config) GetSchemaPath() string

GetSchemaPath returns the path for the schema file.

func (*Config) Init

func (c *Config) Init()

Init reads settings from files and environment variables.

type UI

type UI interface {
	Output(string)
	Warn(string)
	Error(string)
	Confirm(string) (bool, error)
}

UI is an interface to abstract interactions with users.

func NewUI

func NewUI(in io.Reader, out, err io.Writer) UI

NewUI creates new UI object.

Jump to

Keyboard shortcuts

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