settings

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dir = ".realize/"

Functions

This section is empty.

Types

type Config

type Config struct {
	Create bool  `yaml:"-" json:"-"`
	Flimit int64 `yaml:"flimit,omitempty" json:"flimit,omitempty"`
	Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"`
}

Config defines structural options

type Legacy added in v1.4.1

type Legacy struct {
	Status   bool          `yaml:"status" json:"status"`
	Interval time.Duration `yaml:"interval" json:"interval"`
}

Legacy configuration

type Resources

type Resources struct {
	Config  string `yaml:"-" json:"-"`
	Outputs string `yaml:"outputs" json:"outputs"`
	Logs    string `yaml:"logs" json:"log"`
	Errors  string `yaml:"errors" json:"error"`
}

Resources defines the files generated by realize

type Server

type Server struct {
	Status bool   `yaml:"status" json:"status"`
	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 {
	Config    `yaml:",inline" json:"config"`
	Resources `yaml:"resources" json:"resources"`
	Server    `yaml:"server,omitempty" json:"server,omitempty"`
}

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() error

Flimit defines the max number of watched files

func (Settings) Name added in v1.4.1

func (s Settings) Name(name string, path string) string

Name return the project name or the path of the working dir

func (Settings) Path added in v1.4.1

func (s Settings) Path(path string) string

Path cleaner

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) Remove added in v1.4.1

func (s *Settings) Remove() error

Remove realize folder

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

Jump to

Keyboard shortcuts

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