outbox

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName           string
	ServiceIRI            *url.URL
	ServiceEndpointURL    *url.URL
	Topic                 string
	MaxRecipients         int
	MaxConcurrentRequests int
	CacheSize             int
	CacheExpiration       time.Duration
	SubscriberPoolSize    int
}

Config holds configuration parameters for the outbox.

type Outbox

type Outbox struct {
	*Config
	*lifecycle.Lifecycle
	// contains filtered or unexported fields
}

Outbox implements the ActivityPub outbox.

func New

func New(cnfg *Config, s store.Store, pubSub pubSub, t httpTransport, activityHandler service.ActivityHandler,
	apClient activityPubClient, resourceResolver resourceResolver, metrics metricsProvider,
) (*Outbox, error)

New returns a new ActivityPub Outbox.

func (*Outbox) Post

func (h *Outbox) Post(ctx context.Context, activity *vocab.ActivityType, exclude ...*url.URL) (*url.URL, error)

Post posts an activity to the outbox and returns the ID of the activity that was posted. If the activity does not specify an ID then a unique ID will be generated. The 'actor' of the activity is also assigned to the service IRI of the outbox. An exclude list may be provided so that the activity is not posted to the given URLs.

Jump to

Keyboard shortcuts

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