data

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

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

Namespace provides template functions for the "data" namespace.

func New

func New(deps *deps.Deps) *Namespace

New returns a new instance of the data-namespaced template functions.

func (*Namespace) GetCSV

func (ns *Namespace) GetCSV(sep string, urlParts ...string) (d [][]string, err error)

GetCSV expects a data separator and one or n-parts of a URL to a resource which can either be a local or a remote one. The data separator can be a comma, semi-colon, pipe, etc, but only one character. If you provide multiple parts for the URL they will be joined together to the final URL. GetCSV returns nil or a slice slice to use in a short code.

func (*Namespace) GetJSON

func (ns *Namespace) GetJSON(urlParts ...string) (v interface{}, err error)

GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one. If you provide multiple parts they will be joined together to the final URL. GetJSON returns nil or parsed JSON to use in a short code.

Jump to

Keyboard shortcuts

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