Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FuncMap = func() template.FuncMap { f := sprig.HermeticTxtFuncMap() f["getLastIndex"] = func(collection interface{}) int { if v := reflect.ValueOf(collection); v.Kind() == reflect.Slice { return v.Len() - 1 } return 0 } f["byMatchName"] = func(collection interface{}) interface{} { matches, ok := collection.([]models.Match) if !ok { return collection } sort.Sort(models.MatchSort(matches)) return matches } return f }()
FuncMap is a function that returns template.FuncMap with custom functions available to template authors.
Functions ¶
This section is empty.
Types ¶
type Presenter ¶
type Presenter struct {
// contains filtered or unexported fields
}
Presenter is an implementation of presenter.Presenter that formats output according to a user-provided Go text template.
func NewPresenter ¶
func NewPresenter(pb models.PresenterConfig, templateFile string) *Presenter
NewPresenter returns a new template.Presenter.
Click to show internal directories.
Click to hide internal directories.