template

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

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

Go to latest
Published: Jan 16, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, status int, cause error, data map[string]interface{})

Write out the Error template with given status and cause. cause may be left nil.

func HTML

func HTML(s string) template.HTML

Sanitize s and return the results as type template.HTML.

func IsEmpty

func IsEmpty(s *string) bool

Return whether s is either nil or ponting to an, if trimmed, empty string.

func Iter

func Iter(w http.ResponseWriter, r *http.Request, it fetch.Iter)

Write out a page showing activity pub content accessible via iter.

func Remote

func Remote(w http.ResponseWriter, r *http.Request, iri *url.URL)

Write out a page showing remote content at addr.

func Render

func Render(w http.ResponseWriter, r *http.Request, page string, data map[string]interface{})

func URL

func URL(s string) template.URL

Sanitize s and return the results as type template.URL.

Types

type WebVocab

type WebVocab interface {
	// Render out the HTML representation of the wrapped object.
	Fragment() template.HTML

	// Get the type of the underlying wrapped object.
	Type() string

	// Get the IRI of the underlying wrapped object.
	Id() template.URL
}

Represents a wrapped instance of a vocab.Type object. WebVocab provides method for rendering out the underlying vocab object to some safe HTML representation.

func Fetch

func Fetch(fc *fedcontext.FedContext, target *url.URL) (WebVocab, error)

Fetch the ActivityPub object at iri and return a wraped version.

func New

func New(fc *fedcontext.FedContext, target vocab.Type) (WebVocab, error)

Return a wrapped version of target.

func News

func News(fc *fedcontext.FedContext, targets ...vocab.Type) ([]WebVocab, error)

Return wrapped versions of all targets. Returns an error if at least one of the conversations failed.

Jump to

Keyboard shortcuts

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