httpsubscriber

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActorIRIKey is the metadata key for the actor IRI.
	ActorIRIKey = "actor-iri"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceEndpoint string
	BufferSize      int
}

Config holds the HTTP subscriber configuration parameters.

type Subscriber

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

Subscriber implements a subscriber for Watermill that handles HTTP requests.

func New

func New(cfg *Config, sigVerifier signatureVerifier, tm authTokenManager) *Subscriber

New returns a new HTTP subscriber.

func (*Subscriber) Close

func (s *Subscriber) Close() error

Close stops the subscriber.

func (*Subscriber) Handler

func (s *Subscriber) Handler() common.HTTPRequestHandler

Handler returns the handler that should be invoked when an HTTP request is posted to the target endpoint. This handler must be registered with an HTTP server.

func (*Subscriber) Method

func (s *Subscriber) Method() string

Method returns the HTTP method, which is always POST.

func (*Subscriber) Path

func (s *Subscriber) Path() string

Path returns the base path of the target endpoint for this subscriber.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(_ context.Context, _ string) (<-chan *message.Message, error)

Subscribe returns the channel over which incoming messages are sent.

Jump to

Keyboard shortcuts

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