utils

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYamlFileWrapper

func NewYamlFileWrapper(filename string, stdin io.Reader, stdout io.Writer) yamlfile.YamlFile

NewYamlFileWrapper - create new YamlFile wrapper

Types

type TemplateWrapper

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

TemplateWrapper - adapter type around either html/template or text/template packages

func NewTemplateWrapper

func NewTemplateWrapper(format string) (w TemplateWrapper)

NewTemplateWrapper - create new template wrapper

func (TemplateWrapper) Execute

func (w TemplateWrapper) Execute(wr io.Writer, data interface{}) error

Execute - execute

func (TemplateWrapper) NewTextTemplate

func (w TemplateWrapper) NewTextTemplate(templateText string) error

NewTextTemplate - create new text/template

func (TemplateWrapper) ParseFiles

func (w TemplateWrapper) ParseFiles(filenames ...string) error

ParseFiles - parse files

func (TemplateWrapper) ParseGlob

func (w TemplateWrapper) ParseGlob(pattern string) error

ParseGlob - parse glob

type YamlFileWrapper

type YamlFileWrapper struct {
	yamlfile.YamlFile
	// contains filtered or unexported fields
}

YamlFileWrapper - simple wrapper that can either read from STDIN and write to STDOUT when "saved" or normally to/from a file

func (*YamlFileWrapper) Exists

func (y *YamlFileWrapper) Exists() bool

Exists - override

func (*YamlFileWrapper) Filename

func (y *YamlFileWrapper) Filename() string

Filename - override

func (*YamlFileWrapper) Load

func (y *YamlFileWrapper) Load() (loaded bool, err error)

Load - override

func (*YamlFileWrapper) LoadReader

func (y *YamlFileWrapper) LoadReader(reader io.Reader) (loaded bool, err error)

LoadReader - override

func (*YamlFileWrapper) Save

func (y *YamlFileWrapper) Save() (err error)

Save - override

Jump to

Keyboard shortcuts

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