engine

package
v0.0.0-...-a61cce2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIELD_ENGINE        = "engine"
	FIELD_TEMPLATE_NAME = "templateName"
)
View Source
const (
	FIELD_REALPATH      = "realpath"
	FIELD_TEMPLATE_NAME = "templateName"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

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

func (Common) Engine

func (c Common) Engine() *Engine

func (Common) TemplateName

func (c Common) TemplateName() string

type Engine

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

Engine : Main entrypoint of configuration daemon.

This struct manage - lifecycle of source.Source - template lifecycles - value caches

Template can be added dynamically but sources are statically defined at initialization.

func (*Engine) AddTemplates

func (engine *Engine) AddTemplates(paths []string, watch bool)

AddTemplates : Add several templates at runtime

What this method do : - parse template from paths - flag the template whether it need to be watched or not - init some template function (ALookup, SLookup, HLookup, Lookup) in each template

func (*Engine) Close

func (engine *Engine) Close()

Close : close the engine (io.Closer)

What this method do : - close filewatcher - close all sources

func (*Engine) FileWatcher

func (engine *Engine) FileWatcher() *fsnotify.Watcher

FileWatcher : Get all relevant file watcher that being used

by this engine

func (*Engine) Sources

func (engine *Engine) Sources() Sources

Sources : Get all available & declared engine sources

type Registry

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

Registry : registery (for uri alias) only registry no unregistration

func (*Registry) ExpandURI

func (r *Registry) ExpandURI(uri md.LimitedURI) (md.LimitedURI, error)

ExpandURI : expanding URI recursively

func (*Registry) Register

func (r *Registry) Register(alias string, base md.LimitedURI) error

type Relation

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

This can be used for defining which template that need to evaluated if there is value changes.

func EmptyRelation

func EmptyRelation() Relation

func (*Relation) ImpactedSource

func (d *Relation) ImpactedSource(value str) []string

func (*Relation) ImpactedTarget

func (d *Relation) ImpactedTarget(source str) []string

func (*Relation) Relate

func (d *Relation) Relate(source str, target str)

type Template

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

func NewTemplate

func NewTemplate(templ *hb.Template, realpath string, hashed string) *Template

func ParseTemplate

func ParseTemplate(realpath string) (template *Template, err error)

func (*Template) Hash

func (template *Template) Hash() (string, error)

func (*Template) Reload

func (template *Template) Reload()

Jump to

Keyboard shortcuts

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