Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectConfig ¶
type ConnectConfig struct { // ServerURL is the URL of the NATS server endpoint ServerURL string `json:"u,omitempty"` // PublisherJWT contains the NATS listener credentials PublisherJWT string `json:"p,omitempty"` // ListenerJWT contains the NATS publisher credentials ListenerJWT string `json:"l,omitempty"` // Subject is the NATS subject Subject string `json:"s,omitempty"` }
ConnectConfig contains various configuration options for establishing a NATS connection
func (*ConnectConfig) Listener ¶
func (c *ConnectConfig) Listener() (*Listener, error)
Listener creates a NATS listener from the given config
func (*ConnectConfig) Marshal ¶
func (c *ConnectConfig) Marshal() string
Marshal returns the JSON encoding of a ConnectConfig instance
func (*ConnectConfig) Publisher ¶
func (c *ConnectConfig) Publisher() (*Publisher, error)
Publisher creates a NATS publisher from a given config
func (*ConnectConfig) Unmarshal ¶
func (c *ConnectConfig) Unmarshal(buf string) error
Unmarshal parses a JSON-encoded ConnectConfig instance
type ErrRemoteError ¶
type ErrRemoteError struct {
// contains filtered or unexported fields
}
ErrRemoteError represents a remote error
func (*ErrRemoteError) Error ¶
func (e *ErrRemoteError) Error() string
type LambdaListener ¶
type LambdaListener struct {
// contains filtered or unexported fields
}
LambdaListener cretes header for calling lambda. Listens for incoming log lines and response (or multiple) responses.
func NewLambdaListener ¶
func NewLambdaListener(c ListenerConfig) (*LambdaListener, error)
NewLambdaListener creates a new LambdaListener with the given config
func (*LambdaListener) Done ¶
func (l *LambdaListener) Done(ctx context.Context) error
Done blocks until either a response or error is available
func (*LambdaListener) Headers ¶
func (l *LambdaListener) Headers() map[string]string
Headers marshals the NATS publisher config
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener represents a NATS listener
type ListenerConfig ¶
type ListenerConfig struct { // ServerURL is the URL of the NATS server endpoint ServerURL string // PublisherJWT contains the NATS publisher credentials PublisherJWT string // PublisherJWT contains the NATS listener credentials ListenerJWT string // Subject is the NATS subject to listen to Subject string // LogSink is a channel where logs are pushed LogSink func(chan []byte) // Rsp is the struct where response data will be written Rsp interface{} }
ListenerConfig contains various configuration options for LambdaListener
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher represents a NATS publisher
func (*Publisher) Close ¶
Close publishes an empty message to the subject, indicating that the subject is closed