asnormalizer

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

README

#ActivityStream Normalizer

This is an opinionated library that normalizes ActivityStreams 2.0 objects into a standard format that works for Emissary.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actor

func Actor(document streams.Document) map[string]any

Actor normalizes an Actor document

func Announce

func Announce(document streams.Document) map[string]any

Announce normalizes an Announce activity

func Attachment

func Attachment(document streams.Document) []map[string]any

func AttachmentAsImage

func AttachmentAsImage(attachment streams.Document) map[string]any

AttachmentAsImage normalizes an Image object

func Context

func Context(document streams.Document) string

Context computes the document context (not the @context) Using either the context field: https://www.w3.org/ns/activitystreams#context or the (deprecated) ostatus:conversation field

func Dislike

func Dislike(document streams.Document) map[string]any

Dislike normalizes a Dislike activity

func Image

func Image(image streams.Image) map[string]any

Image normalizes an Image object

func Like

func Like(document streams.Document) map[string]any

func Normalize

func Normalize(document streams.Document) map[string]any

func Object

func Object(document streams.Document) map[string]any

Object normalizes a regular document (Article, Note, etc)

func Tags

func Tags(document streams.Document) []map[string]any

Tags normalizes a slice of Tag values

Types

type Client

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

func New

func New(innerClient streams.Client) *Client

func (*Client) Load

func (client *Client) Load(uri string, options ...any) (streams.Document, error)

Jump to

Keyboard shortcuts

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