Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsActivityPubContentType ¶
IsActivityPubContentType returns true if the specified content-type is an ActivityPub content-type
Types ¶
type DebugLevel ¶
type DebugLevel uint8
DebugLevel is a custom enumeration that defines various levels of debug output.
const DebugLevelNone DebugLevel = 0
DebugLevelNone is the default debug level. Using this setting, no debug messages will be printed.
const DebugLevelTerse DebugLevel = 100
DebugLevelTerse is a debug level that prints only the most important messages.
const DebugLevelVerbose DebugLevel = 200
DebugLevelVerbose is a debug level that prints all debug messages.
func (DebugLevel) String ¶
func (debugLevel DebugLevel) String() string
String implements the Stringer interface, and returns a human-readable version of the DebugLevel.
type RouteHandler ¶
RouteHandler is a function that handles a specific type of ActivityPub activity. RouteHandlers are registered with the Router object along with the names of the activity types that they correspond to.
type Router ¶
type Router[T any] struct { // contains filtered or unexported fields }
Router is a simple object that routes incoming ActivityPub activities to the appropriate handler
func (*Router[T]) Add ¶
func (router *Router[T]) Add(activityType string, objectType string, routeHandler RouteHandler[T])
Add puts a new route to the router. You can use "*" as a wildcard for either the activityType or objectType. The Handler method tries to match handlers from most specific to least specific. activity/object activity/* */object */*
For performance reasons, this function is not thread-safe. So, you should add all routes before starting the server, for instance, in your app's `init` functions.