synced

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

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

Template used for creating synced templates parsed once

func New

func New(t string) (*Template, error)

New parses string and creates new instance of Template

func (*Template) Execute

func (syn *Template) Execute(writer io.Writer, data interface{}) error

Execute template

func (*Template) ExecuteString

func (input *Template) ExecuteString(data interface{}) (string, error)

ExecuteString execute template with data

func (Template) MarshalJSON

func (syn Template) MarshalJSON() ([]byte, error)

MarshalJSON marshal template to json string

func (*Template) String

func (syn *Template) String() string

String return text pattern

func (Template) TreatAs

func (syn Template) TreatAs() string

func (*Template) UnmarshalJSON

func (syn *Template) UnmarshalJSON(arg []byte) error

UnmarshalJSON un-marshal from json string

type TemplateMap

type TemplateMap map[string]*Template

func (TemplateMap) Execute

func (tm TemplateMap) Execute(data interface{}) (map[string]string, error)

Execute templates and return new map[string]string

Jump to

Keyboard shortcuts

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