ttgo

package
v0.0.0-...-1e20ff0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlagTmpl string
	FlagData []string
)
View Source
var Command = &cobra.Command{
	Use:   "ttgo [flags] <FILE>...",
	Short: headline.Get(helpTxt),
	Long:  helpTxt,
	RunE:  Run,
}

Functions

func Exec

func Exec(tmpl *Template, r io.Reader, it Input) error

func ExecFile

func ExecFile(tmpl *Template, file string, it Input) error

func Run

func Run(cmd *cobra.Command, args []string) error

Types

type Context

type Context struct {
	Input Input  `json:"Input"`
	Data  string `json:"Data"`
}

func (*Context) String

func (c *Context) String() string

type Input

type Input struct {
	Type InputType `json:"Type"`
	File string    `json:"File"`
}

type InputType

type InputType string
const (
	STDIN InputType = "stdin"
	DATA  InputType = "data"
	FILE  InputType = "file"
)

type Template

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

func NewTemplate

func NewTemplate(file string) (*Template, error)

func (*Template) Execute

func (te *Template) Execute(data any) (string, error)

func (*Template) FuncMap

func (te *Template) FuncMap() map[string]any

Jump to

Keyboard shortcuts

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