collection

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package collection is an HTTP interface for GET-ing activities from an ActivityPub collection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx echo.Context, idFunc IdentifierFunc, countFunc CounterFunc, iteratorFunc IteratorFunc, options ...Option) error

Serve generates a data for the collection that can be retured via HTTP, returning ActivityStreams OrderedCollection or OrderedCollectionPage of outbound activities. The `storage` parameter is assumed to already contain any necessary filtering information such as Actor permissions and "after" cursors.

Types

type Config added in v0.15.1

type Config struct {
	SSEEndpoint string
}

Config represents optional configuration parameters for a collection

func NewConfig added in v0.15.1

func NewConfig(options ...Option) Config

NewConfig creates a new Config struct with the provided options

type CounterFunc added in v0.15.1

type CounterFunc func() (int64, error)

type IdentifierFunc added in v0.15.1

type IdentifierFunc func() string

type IteratorFunc added in v0.15.1

type IteratorFunc func(startIndex string) (iter.Seq[mapof.Any], error)

type Option added in v0.15.1

type Option func(config *Config)

Option is a functional option that can be used to configure a collection

func WithSSEEndpoint added in v0.15.1

func WithSSEEndpoint(endpoint string) Option

WithSSEEndpoint sets the URL endpoint for Server-Sent Events (SSE) updates related to this collection

Jump to

Keyboard shortcuts

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