Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAttributedTo ¶
func ExtractContent ¶
ExtractContent extracts the ActivityPub / ActivityStreams 'content' from the ActivityHTML.
ExtractContent expects the ActivityPub / ActivityStreams 'content' to be the <main> element. For example:
<main typeof="https://www.w3.org/ns/activitystreams#Note"> <p> Hello world! </p> </main>
In this example, the ActivityPub / ActivityStreams 'type' is:
`<main typeof="https://www.w3.org/ns/activitystreams#Note"> <p> Hello world! </p> </main>`
This assumes that there is only a single <main> element.
func ExtractTo ¶
ExtractTo extracts the ActivityPub / ActivityStreams 'to' from the ActivityHTML.
Note that it currently is hard-coded to:
[]string{"https://www.w3.org/ns/activitystreams#Public"}
func ExtractType ¶
ExtractType extracts the ActivityPub / ActivityStreams 'type' from the ActivityHTML.
ExtractType expects the ActivityPub / ActivityStreams 'type' to be one the <main> element. For example:
<main typeof="https://www.w3.org/ns/activitystreams#Note"> <p> Hello world! </p> </main>
In this example, the ActivityPub / ActivityStreams 'type' is:
[]string{"https://www.w3.org/ns/activitystreams#Note"
Also, for example:
<main typeof="https://www.w3.org/ns/activitystreams#Note https://www.w3.org/ns/activitystreams#Article"> <p> Hello world! </p> </main>
In this example, the ActivityPub / ActivityStreams 'type' is:
[]string{ "https://www.w3.org/ns/activitystreams#Note", "https://www.w3.org/ns/activitystreams#Article", }
Types ¶
type HTTPHandler ¶
HTTPHandler is http.Handler middleware.
If the client has "application/activity+json" in their "Accept" request header, then will HTTPHandler r ActivityPub / ActivityStream ("application/activity+json") JSON data by transforming ActivityHTML into "application/activity+json".
func (HTTPHandler) ServeHTTP ¶
func (receiver HTTPHandler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request)