server

package
v0.0.0-...-e8623e9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFlagSet

func DefaultFlagSet() *flag.FlagSet

func Run

func Run(ctx context.Context, logger *slog.Logger) error

func RunWithFlagSet

func RunWithFlagSet(ctx context.Context, fs *flag.FlagSet, logger *slog.Logger) error

func RunWithOptions

func RunWithOptions(ctx context.Context, opts *RunOptions, logger *slog.Logger) error

Types

type CustomHandlersFunc

type CustomHandlersFunc func(*http.ServeMux) error

CustomHandlersFunc is an optional function for assigning custom handlers to a [http.ServeMux] instance.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

MiddlewareFunc is an optional function for applying custom middleware to human-facing web pages.

type RunOptions

type RunOptions struct {
	ServerURI             string
	URIs                  *uris.URIs
	AccountsDatabaseURI   string
	AliasesDatabaseURI    string
	FollowersDatabaseURI  string
	FollowingDatabaseURI  string
	NotesDatabaseURI      string
	MessagesDatabaseURI   string
	BlocksDatabaseURI     string
	PostsDatabaseURI      string
	PropertiesDatabaseURI string
	LikesDatabaseURI      string
	BoostsDatabaseURI     string
	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
	AllowRemoteIconURI       bool
	Verbose                  bool
	Templates                *template.Template
	AccountHandlerMiddleware MiddlewareFunc
	PostHandlerMiddleware    MiddlewareFunc
	CustomHandlers           CustomHandlersFunc
	ProcessMessageQueueURI   string
}

func OptionsFromFlagSet

func OptionsFromFlagSet(ctx context.Context, fs *flag.FlagSet) (*RunOptions, error)

Jump to

Keyboard shortcuts

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