template

package
v0.0.0-...-e6d1baa Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptySrcErr = errors.New("empty src template")

Functions

func ProcessOnce

func ProcessOnce(config *Config) error

func UnmarshalJsonArray

func UnmarshalJsonArray(data string) ([]interface{}, error)

func UnmarshalJsonObject

func UnmarshalJsonObject(data string) (map[string]interface{}, error)

Types

type Config

type Config struct {
	ParentDir    string
	ConfDir      string
	TemplateDir  string
	Prefix       string
	Noop         bool
	StoreClient  store.StoreClient
	KeepTempFile bool
}

Template global config , value init from topod config

type Processor

type Processor interface {
	Process()
}

func NewWatcher

func NewWatcher(config *Config, stopChan, doneChan chan bool, errChan chan error) Processor

type TemplateResource

type TemplateResource struct {
	CheckCmd  string `toml:"check_cmd"`
	Dest      string `toml:"dest"`
	FileMode  os.FileMode
	Gid       int
	Keys      []string `toml:"keys"`
	Mode      string   `toml:"mode"`
	Prefix    string   `toml:"prefix"`
	ReloadCmd string   `toml:"reload_cmd"`
	Src       string   `toml:"src"`
	TempFile  *os.File
	Backup    bool   `toml:"backup"`
	BackupDir string `toml:"backupdir"`
	Uid       int
	// contains filtered or unexported fields
}

Template file parsed config, part of vars from template global config above, some from xxx_xxx.toml config file

func NewConfigTemplate

func NewConfigTemplate(path string, config *Config) (*TemplateResource, error)

* New template resource from toml config file in conf.d

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func (*Watcher) Process

func (w *Watcher) Process()

Jump to

Keyboard shortcuts

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