www

package
v0.0.0-...-fbce3e8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountHandler

func AccountHandler(opts *AccountHandlerOptions) (http.Handler, error)

func FollowersHandler

func FollowersHandler(opts *FollowersHandlerOptions) (http.Handler, error)

func FollowingHandler

func FollowingHandler(opts *FollowingHandlerOptions) (http.Handler, error)

func IconHandler

func IconHandler(opts *IconHandlerOptions) (http.Handler, error)

func InboxPostHandler

func InboxPostHandler(opts *InboxPostHandlerOptions) (http.Handler, error)

func IsActivityStreamRequest

func IsActivityStreamRequest(req *http.Request, header string) bool

func LoggerWithRequest

func LoggerWithRequest(req *http.Request, logger *slog.Logger) *slog.Logger

func OutboxGetHandler

func OutboxGetHandler(opts *OutboxGetHandlerOptions) (http.Handler, error)

func OutboxPostHandler

func OutboxPostHandler(opts *OutboxPostHandlerOptions) (http.Handler, error)

func PostHandler

func PostHandler(opts *PostHandlerOptions) (http.Handler, error)

func ReadUserIP

func ReadUserIP(req *http.Request) string

func WebfingerHandler

func WebfingerHandler(opts *WebfingerHandlerOptions) (http.Handler, error)

Types

type AccountHandlerOptions

type AccountHandlerOptions struct {
	AccountsDatabase   activitypub.AccountsDatabase
	AliasesDatabase    activitypub.AliasesDatabase
	PropertiesDatabase activitypub.PropertiesDatabase
	URIs               *uris.URIs
	Templates          *template.Template
	RedirectOnAlias    bool
}

type AccountTemplateVars

type AccountTemplateVars struct {
	Account    *activitypub.Account
	AccountURL string
	// To do: URLs (properties)
	IconURL       string
	PropertiesMap map[string]*activitypub.Property
	URLProperties map[string]string
}

type FollowersHandlerOptions

type FollowersHandlerOptions struct {
	AccountsDatabase  activitypub.AccountsDatabase
	FollowersDatabase activitypub.FollowersDatabase
	URIs              *uris.URIs
}

type FollowingHandlerOptions

type FollowingHandlerOptions struct {
	AccountsDatabase  activitypub.AccountsDatabase
	FollowingDatabase activitypub.FollowingDatabase
	URIs              *uris.URIs
}

type IconHandlerOptions

type IconHandlerOptions struct {
	AccountsDatabase activitypub.AccountsDatabase
	URIs             *uris.URIs
	AllowRemote      bool
}

type InboxPostHandlerOptions

type InboxPostHandlerOptions struct {
	AccountsDatabase    activitypub.AccountsDatabase
	FollowersDatabase   activitypub.FollowersDatabase
	FollowingDatabase   activitypub.FollowingDatabase
	MessagesDatabase    activitypub.MessagesDatabase
	NotesDatabase       activitypub.NotesDatabase
	PostsDatabase       activitypub.PostsDatabase
	BlocksDatabase      activitypub.BlocksDatabase
	LikesDatabase       activitypub.LikesDatabase
	BoostsDatabase      activitypub.BoostsDatabase
	ProcessMessageQueue activitypub.ProcessMessageQueue
	URIs                *uris.URIs
	AllowFollow         bool
	AllowCreate         bool
	AllowLikes          bool
	AllowBoosts         bool
	// Allows posts to accounts not followed by author but where account is mentioned in post
	AllowMentions bool
}

type OutboxGetHandlerOptions

type OutboxGetHandlerOptions struct {
	AccountsDatabase activitypub.AccountsDatabase
	PostsDatabase    activitypub.PostsDatabase
	URIs             *uris.URIs
}

type OutboxPostHandlerOptions

type OutboxPostHandlerOptions struct {
	AccountsDatabase activitypub.AccountsDatabase
	PostsDatabase    activitypub.PostsDatabase
	URIs             *uris.URIs
}

type PostHandlerOptions

type PostHandlerOptions struct {
	AccountsDatabase activitypub.AccountsDatabase
	PostsDatabase    activitypub.PostsDatabase
	URIs             *uris.URIs
	Templates        *template.Template
}

type PostHandlerVars

type PostHandlerVars struct {
	Post       *activitypub.Post
	PostBody   template.HTML
	Account    *activitypub.Account
	AccountURL string
	PostURL    string
	IconURL    string
}

type WebfingerHandlerOptions

type WebfingerHandlerOptions struct {
	AccountsDatabase activitypub.AccountsDatabase
	AliasesDatabase  activitypub.AliasesDatabase
	URIs             *uris.URIs
}

Jump to

Keyboard shortcuts

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