debug

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CSS describes the styling for dumps to be sent back
	// to the front end.
	CSS = `` /* 561-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

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

Namespace defines the methods for debug to be used as template functions.

func New

func New(d *deps.Deps) *Namespace

Creates a new debug Namespace

func (*Namespace) Debug

func (ns *Namespace) Debug(i interface{}) template.HTML

Debug

Returns a pretty print of the interface passed. This function is a shortcut for fmt.Sprintf

Example: {{ debug .post }}

func (*Namespace) Dump

func (ns *Namespace) Dump(i interface{}) (template.HTML, error)

Dump

Uses the litter package to dump the passed interface. inside a div with CSS attached.

Returns errors.TEMPLATE if the marshal failed.

Example: {{ dump .post }}

Jump to

Keyboard shortcuts

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