template

package
v0.0.0-...-7e4aa60 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(y int, x int) int

Add do additions to number.

func AlignLeft

func AlignLeft(size int, str string) string

AlignLeft aligns text to the left.

func AlignRight

func AlignRight(size int, str string) string

AlignRight aligns text to the right.

func Capitalize

func Capitalize(str string) string

Capitalize capitalizes first character in string.

func Center

func Center(size int, str string) string

Center centers string.

func Compile

func Compile(s string, d map[string]interface{}) (*bytes.Buffer, error)

Parse template.

func Date

func Date(args ...interface{}) string

Date return date as formated string.

func Default

func Default(def interface{}, inpOpt ...interface{}) interface{}

Default returns default if argument is empty.

func Div

func Div(y int, x int) int

Div do divisions to number.

func Even

func Even(x int) bool

Even return true if it's an even number.

func Join

func Join(sep string, inp []interface{}) string

Join elements in an array to a string.

func Keys

func Keys(inp interface{}) (interface{}, error)

Keys from interface{}.

func Last

func Last(i int, inp interface{}) (bool, error)

Last element in array.

func Map

func Map(inp interface{}) bool

Map returns true if type is a map.

func Mul

func Mul(y int, x int) int

Mul do multiplication to number.

func Odd

func Odd(x int) bool

Odd return true if it's an odd number.

func Random

func Random(size int) int

Random returns random number.

func Repeat

func Repeat(rep int, inp string) string

Repeat string x number of times.

func Replace

func Replace(oldStr string, newStr string, str string) string

Replace string.

func Split

func Split(sep string, inp string) []interface{}

Split string into an array.

func Sub

func Sub(y int, x int) int

Sub do subtractions to number.

func Trim

func Trim(trim string, str string) string

Trim trims characters on the left and right side of the string.

func TrimLeft

func TrimLeft(trim string, str string) string

TrimLeft trims characters on the left side of the string.

func TrimRight

func TrimRight(trim string, str string) string

TrimRight trims characters on the right side of string.

func Type

func Type(inp interface{}) string

Type of variable (usefull for debugging templates).

Types

This section is empty.

Jump to

Keyboard shortcuts

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