- Go 100%
| actorxml.go | ||
| actorxml_test.go | ||
| fileextension.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| logger.go | ||
| mediatype.go | ||
| README.md | ||
| transform.go | ||
| transform_test.go | ||
| wraphttphandler.go | ||
go-hactor
Package hactor provides an http.Handler middleware to render hactor (structured-HTML) to HTML, for the Go programming language.
hactor is an HTML based format for creating ActivityPub / ActivityStreams actors
—
Application,
Feed,
Group,
Organization,
Person,
Service,
etc.
An example hactor of type Person is:
<x-person>
<x-name>Joe Blow</x-name>
<x-handle>spaceace</x-handle>
<x-message>
<p>
Hello, how do you do?
</p>
</x-message>
</x-person>
An example hactor of type Application is:
<x-application>
<x-name>Joe Blow</x-name>
<x-handle>spaceace</x-handle>
<x-message>
<p>
Hello, how do you do?
</p>
</x-message>
</x-application>
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-hactor
Example
Here is an example of using hactor.WrapHTTPHandler() to wrap another handler, to provide hactor (structured-HTML) to HTML rendering.
The http.Handler that hactor.WrapHTTPHandler() returns looks at what the sub-http.Handler to see if the Content-Type it wrote has text/excerpt+html.
import "codeberg.org/reiver/go-hactor"
// ...
var handler http.Handler = ...
handler = hactor.WrapHTTPHandler(handler) // <---------
err := http.ListenAndServe(":8080", handler)
if nil != err {
return err
}
Import
To import package hactor use import code like the following:
import "codeberg.org/reiver/go-hactor"
Installation
To install package hactor do the following:
GOPROXY=direct go get codeberg.org/reiver/go-hactor
Author
Package hactor was written by Charles Iliya Krempeaux