Documentation
¶
Index ¶
- func ActivityFromPost(ctx context.Context, uris_table *uris.URIs, acct *activitypub.Account, ...) (*ap.Activity, error)
- func AddPost(ctx context.Context, opts *AddPostOptions, acct *activitypub.Account, ...) (*activitypub.Post, []*activitypub.PostTag, error)
- func GetPostFromObjectURI(ctx context.Context, uris_table *uris.URIs, posts_db database.PostsDatabase, ...) (*activitypub.Post, error)
- func NoteFromPost(ctx context.Context, uris_table *uris.URIs, acct *activitypub.Account, ...) (*ap.Note, error)
- type AddPostOptions
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.
Types ¶
type AddPostOptions ¶
type AddPostOptions struct {
URIs *uris.URIs
PostsDatabase database.PostsDatabase
PostTagsDatabase database.PostTagsDatabase
}
Click to show internal directories.
Click to hide internal directories.