settings

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blue

type Blue struct{}

Blue color

func (Blue) Bold

func (c Blue) Bold(t ...interface{}) string

Bold font in blue

func (Blue) Regular

func (c Blue) Regular(t ...interface{}) string

Regular font in blue

type Colors

type Colors struct {
	Red
	Blue
	Yellow
	Magenta
	Green
}

Colors allowed

type Config

type Config struct {
	Flimit uint64 `yaml:"flimit" json:"flimit"`
}

Config defines structural options

type Green

type Green struct{}

Green color

func (Green) Bold

func (c Green) Bold(t ...interface{}) string

Bold font in red

func (Green) Regular

func (c Green) Regular(t ...interface{}) string

Regular font in green

type Magenta

type Magenta struct{}

Magenta color

func (Magenta) Bold

func (c Magenta) Bold(t ...interface{}) string

Bold font in magenta

func (Magenta) Regular

func (c Magenta) Regular(t ...interface{}) string

Regular font in magenta

type Red

type Red struct{}

Red color

func (Red) Bold

func (c Red) Bold(t ...interface{}) string

Bold font in red

func (Red) Regular

func (c Red) Regular(t ...interface{}) string

Regular font in red

type Resources

type Resources struct {
	Config  string `yaml:"-" json:"-"`
	Streams string `yaml:"streams" json:"output"`
	Logs    string `yaml:"logs" json:"log"`
	Errors  string `yaml:"errors" json:"error"`
}

Resources defines the files generated by realize

type Server

type Server struct {
	Enabled bool   `yaml:"enable" json:"enable"`
	Open    bool   `yaml:"open" json:"open"`
	Host    string `yaml:"host" json:"host"`
	Port    int    `yaml:"port" json:"port"`
}

Server settings, used for the web panel

type Settings

type Settings struct {
	Colors    `yaml:"-"`
	Resources `yaml:"resources" json:"resources"`
	Server    `yaml:"server" json:"server"`
	Config    `yaml:"config" json:"config"`
}

Settings defines a group of general settings

func (Settings) Create

func (s Settings) Create(path string, name string) *os.File

Create a new file and return its pointer

func (Settings) Fatal

func (s Settings) Fatal(err error, msg ...interface{})

Fatal prints a fatal error with its additional messages

func (*Settings) Flimit

func (s *Settings) Flimit()

Flimit defines the max number of watched files

func (*Settings) Read

func (s *Settings) Read(out interface{}) error

Read from config file

func (*Settings) Record

func (s *Settings) Record(out interface{}) error

Record create and unmarshal the yaml config file

func (Settings) Stream

func (s Settings) Stream(file string) ([]byte, error)

Stream return a byte stream of a given file

func (Settings) Validate

func (s Settings) Validate(err error) error

Validate checks a fatal error

func (Settings) Wdir

func (s Settings) Wdir() string

Wdir return the current working directory

func (Settings) Write

func (s Settings) Write(name string, data []byte) error

Write a file given a name and a byte stream

type Yellow

type Yellow struct{}

Yellow color

func (Yellow) Bold

func (c Yellow) Bold(t ...interface{}) string

Bold font in red

func (Yellow) Regular

func (c Yellow) Regular(t ...interface{}) string

Regular font in yellow

Jump to

Keyboard shortcuts

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