template

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMode = os.FileMode(0777)

DefaultMode defines default permission bits for template file

View Source
const JSONExt = ".json"

JSONExt - JSON extension

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads/writes process templates to path

func NewTemplateReader

func NewTemplateReader(path string, log logging.Logger) (*Reader, error)

NewTemplateReader returns a new instance of template reader with given path. The path is also verified and crated if not existed

func (*Reader) GetAllTemplates

func (r *Reader) GetAllTemplates() ([]*process.Template, error)

GetAllTemplates reads all templates from reader's path. Error is returned if path is not a directory. All JSON file are read and un-marshaled as template objects

func (*Reader) WriteTemplate

func (r *Reader) WriteTemplate(template *process.Template, permission os.FileMode) error

WriteTemplate creates a new file (defined by template name) and writes it to the reader's path

Directories

Path Synopsis
model

Jump to

Keyboard shortcuts

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