activityhandler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ServiceName is the name of the service (used for logging).
	ServiceName string

	// ServiceIRI is the IRI of the local service (actor). It is used as the 'actor' in activities
	// that are posted to the outbox by the handler.
	ServiceIRI *url.URL

	// BufferSize is the size of the Go channel buffer for a subscription.
	BufferSize int

	// MaxWitnessDelay is the maximum delay from when the witness receives the transaction (via an Offer) for
	// the witness to include the transaction into the ledger.
	MaxWitnessDelay time.Duration
}

Config holds the configuration parameters for the activity handler.

type Inbox

type Inbox struct {
	*service.Handlers
	// contains filtered or unexported fields
}

Inbox handles activities posted to the inbox.

func NewInbox

func NewInbox(cfg *Config, s store.Store, outbox service.Outbox, t httpTransport,
	opts ...service.HandlerOpt) *Inbox

NewInbox returns a new ActivityPub inbox activity handler.

func (*Inbox) HandleActivity

func (h *Inbox) HandleActivity(activity *vocab.ActivityType) error

HandleActivity handles the ActivityPub activity in the inbox.

func (Inbox) Subscribe

func (h Inbox) Subscribe() <-chan *vocab.ActivityType

Subscribe allows a client to receive published activities.

type Outbox

type Outbox struct {
	// contains filtered or unexported fields
}

Outbox handles activities posted to the outbox.

func NewOutbox

func NewOutbox(cfg *Config, s store.Store, t httpTransport) *Outbox

NewOutbox returns a new ActivityPub outbox activity handler.

func (*Outbox) HandleActivity

func (h *Outbox) HandleActivity(activity *vocab.ActivityType) error

HandleActivity handles the ActivityPub activity in the outbox.

func (Outbox) Subscribe

func (h Outbox) Subscribe() <-chan *vocab.ActivityType

Subscribe allows a client to receive published activities.

Jump to

Keyboard shortcuts

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