formats

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// JSONString const to save on duplicate variable names
	JSONString = "json"
	// IDString const to save on duplicates for Go templates
	IDString = "{{.ID}}"
)

Variables

This section is empty.

Functions

func NewParse

func NewParse(tag, format string) (*template.Template, error)

NewParse creates a new tagged template with the basic functions and parses the given format.

func Parse

func Parse(format string) (*template.Template, error)

Parse creates a new anonymous template with the basic functions and parses the given format.

Types

type JSONStruct

type JSONStruct struct {
	Output interface{}
}

JSONStruct for JSON output

func (JSONStruct) Out

func (j JSONStruct) Out() error

Out method for JSON struct

type JSONStructArray

type JSONStructArray struct {
	Output []interface{}
}

JSONStructArray for JSON output

func (JSONStructArray) Out

func (j JSONStructArray) Out() error

Out method for JSON Arrays

type StdoutTemplate

type StdoutTemplate struct {
	Output   interface{}
	Template string
	Fields   map[string]string
}

StdoutTemplate for Go template output

func (StdoutTemplate) Out

func (t StdoutTemplate) Out() error

Out method for Go templates

type StdoutTemplateArray

type StdoutTemplateArray struct {
	Output   []interface{}
	Template string
	Fields   map[string]string
}

StdoutTemplateArray for Go template output

func (StdoutTemplateArray) Out

func (t StdoutTemplateArray) Out() error

Out method for Go templates

type Writer

type Writer interface {
	Out() error
}

Writer interface for outputs

type YAMLStruct

type YAMLStruct struct {
	Output interface{}
}

YAMLStruct for YAML output

func (YAMLStruct) Out

func (y YAMLStruct) Out() error

Out method for YAML

Jump to

Keyboard shortcuts

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