Documentation ¶
Index ¶
- Constants
- type Option
- type Transport
- func (t *Transport) GetPath() string
- func (t *Transport) GetPort() int
- func (t *Transport) HasConverter() bool
- func (t *Transport) HasTracePropagation() bool
- func (t *Transport) Notification(ctx context.Context, notif *snshttp.Notification) error
- func (t *Transport) Send(ctx context.Context, event cloudevents.Event) (context.Context, *cloudevents.Event, error)
- func (t *Transport) SetConverter(c transport.Converter)
- func (t *Transport) SetReceiver(r transport.Receiver)
- func (t *Transport) StartReceiver(ctx context.Context) (err error)
Constants ¶
View Source
const ( // DefaultShutdownTimeout defines the default timeout given to the http.Server when calling Shutdown. DefaultShutdownTimeout = time.Minute * 1 // TransportName is the name of this transport. TransportName = "AWS SNS" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is the function signature required to be considered an nats.Option.
func WithEncoding ¶
WithEncoding sets the encoding for NATS transport.
func WithShutdownTimeout ¶
WithShutdownTimeout sets the shutdown timeout when the http server is being shutdown.
type Transport ¶
type Transport struct { snshttp.DefaultHandler Encoding encoding.Encoding Client *_sns.SNS TopicARN string // Port is the port to bind the receiver to. Defaults to 8080. Port *int // Path is the path to bind the receiver to. Defaults to "/". Path string // Handler is the handler the http Server will use. Use this to reuse the // http server. If nil, the Transport will create a one. Handler *http.ServeMux // ShutdownTimeout defines the timeout given to the http.Server when calling Shutdown. // If nil, DefaultShutdownTimeout is used. ShutdownTimeout *time.Duration Receiver transport.Receiver // Converter is invoked if the incoming transport receives an undecodable // message. Converter transport.Converter // contains filtered or unexported fields }
Transport acts as both a http client and a http handler.
func (*Transport) HasConverter ¶
HasConverter implements Transport.HasConverter
func (*Transport) HasTracePropagation ¶
HasTracePropagation implements Transport.HasTracePropagation
func (*Transport) Notification ¶
Notification is called for messages published to the SNS Topic. When using DefaultHandler as above this is the only event you need to implement.
func (*Transport) Send ¶
func (t *Transport) Send(ctx context.Context, event cloudevents.Event) (context.Context, *cloudevents.Event, error)
Send implements Transport.Send
func (*Transport) SetConverter ¶
SetConverter implements Transport.SetConverter
func (*Transport) SetReceiver ¶
SetReceiver implements Transport.SetReceiver
Click to show internal directories.
Click to hide internal directories.