Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ServicePath string
ServiceIRI *url.URL
ServiceEndpointURL *url.URL
ActivityHandlerBufferSize int
VerifyActorInSignature bool
// MaxWitnessDelay is the maximum delay that the witnessed transaction becomes included into the ledger.
MaxWitnessDelay time.Duration
IRICacheSize int
IRICacheExpiration time.Duration
OutboxSubscriberPoolSize int
InboxSubscriberPoolSize int
}
Config holds the configuration parameters for an ActivityPub service.
type PubSub ¶
type PubSub interface {
Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)
SubscribeWithOpts(ctx context.Context, topic string, opts ...pubsub.Option) (<-chan *message.Message, error)
Publish(topic string, messages ...*message.Message) error
Close() error
}
PubSub defines the functions for a publisher/subscriber.
type Service ¶
Service implements an ActivityPub service which has an inbox, outbox, and handlers for the various ActivityPub activities.
func New ¶
func New(cfg *Config, activityStore store.Store, t httpTransport, sigVerifier signatureVerifier, pubSub PubSub, activityPubClient activityPubClient, resourceResolver resourceResolver, tm authTokenManager, m metricsProvider, handlerOpts ...spi.HandlerOpt, ) (*Service, error)
New returns a new ActivityPub service.
func (*Service) InboxHTTPHandler ¶
func (s *Service) InboxHTTPHandler() common.HTTPHandler
InboxHTTPHandler returns the HTTP handler for the inbox which is invoked by the HTTP server. This handler must be registered with an HTTP server.
func (*Service) InboxHandler ¶ added in v1.0.0
func (s *Service) InboxHandler() spi.InboxHandler
InboxHandler returns the handler for inbox activities.
func (*Service) Subscribe ¶
func (s *Service) Subscribe() <-chan *vocab.ActivityType
Subscribe allows a client to receive published activities.
Click to show internal directories.
Click to hide internal directories.