www

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: BSD-3-Clause Imports: 44 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   database.AccountsDatabase
	AliasesDatabase    database.AliasesDatabase
	PropertiesDatabase database.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  database.AccountsDatabase
	FollowersDatabase database.FollowersDatabase
	URIs              *uris.URIs
}

type FollowingHandlerOptions

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

type IconHandlerOptions

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

type InboxPostHandlerOptions

type InboxPostHandlerOptions struct {
	AccountsDatabase     database.AccountsDatabase
	FollowersDatabase    database.FollowersDatabase
	FollowingDatabase    database.FollowingDatabase
	MessagesDatabase     database.MessagesDatabase
	NotesDatabase        database.NotesDatabase
	PostsDatabase        database.PostsDatabase
	BlocksDatabase       database.BlocksDatabase
	LikesDatabase        database.LikesDatabase
	BoostsDatabase       database.BoostsDatabase
	ProcessMessageQueue  queue.ProcessMessageQueue
	ProcessFollowerQueue queue.ProcessFollowerQueue
	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 database.AccountsDatabase
	PostsDatabase    database.PostsDatabase
	URIs             *uris.URIs
}

type OutboxPostHandlerOptions

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

type PostHandlerOptions

type PostHandlerOptions struct {
	AccountsDatabase database.AccountsDatabase
	PostsDatabase    database.PostsDatabase
	PostTagsDatabase database.PostTagsDatabase
	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 database.AccountsDatabase
	AliasesDatabase  database.AliasesDatabase
	URIs             *uris.URIs
}

Jump to

Keyboard shortcuts

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