contenttype

package
v0.0.0-...-811c2de Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultContentType = new(text.Plain)

Default content type to be used when no content type is specified or no matching content type is found in the registry.

View Source
var Registry = map[string]ContentType{
	"text/plain":    new(text.Plain),
	"text/markdown": new(text.Markdown),
	"user/profile":  new(user.Profile),
	"test/error":    new(test.Error),
}

The registry maps content type strings to instances of ContentType. XXX This is probably less than ideal, and could maybe be done with introspection, but will serve for now.

Functions

This section is empty.

Types

type ContentType

type ContentType interface {
	RenderDisplayContent(content interface{}) (string, error)
	RenderIndexContent(content interface{}) (string, error)
	Safe() bool
}

A content type encodes the data in an entity for display on the site.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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