formats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

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