posts

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: BSD-3-Clause Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivityFromPost

func ActivityFromPost(ctx context.Context, uris_table *uris.URIs, acct *activitypub.Account, post *activitypub.Post, mentions []*activitypub.PostTag) (*ap.Activity, error)

ActivityFromPost creates a new (ActivityPub) `Activity` instance derived from 'acct', 'post' and 'post_tags'.

func AddPost

func AddPost(ctx context.Context, opts *AddPostOptions, acct *activitypub.Account, body string) (*activitypub.Post, []*activitypub.PostTag, error)

AddPost creates a new post record for 'body' and adds it to the post database. Then it parses 'body' looking for other ActivityPub addresses and records each as a "mention" in the post tags database. It returns the post and the list of post tags (mentions) for further processing as needed.

func GetPostFromObjectURI

func GetPostFromObjectURI(ctx context.Context, uris_table *uris.URIs, posts_db database.PostsDatabase, object_uri string) (*activitypub.Post, error)

GetPostFromObjectURI attempt to derive a `Post` ID and its matching instance from an (ActivityPub) object URI.

func NoteFromPost

func NoteFromPost(ctx context.Context, uris_table *uris.URIs, acct *activitypub.Account, post *activitypub.Post, post_tags []*activitypub.PostTag) (*ap.Note, error)

NoteFromPost creates a new (ActivityPub) `Note` instance derived from 'acct', 'post' and 'post_tags'.

Types

type AddPostOptions

type AddPostOptions struct {
	URIs             *uris.URIs
	PostsDatabase    database.PostsDatabase
	PostTagsDatabase database.PostTagsDatabase
}

Jump to

Keyboard shortcuts

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