Documentation
¶
Index ¶
- Variables
- func SetupNatsInstance(ctx context.Context) (string, testcontainers.Container, func(), error)
- type Config
- type Handler
- type InMem
- func (p *InMem) Close() error
- func (p *InMem) Publish(ctx context.Context, subject string, data []byte) error
- func (p *InMem) Request(ctx context.Context, subject string, data []byte) ([]byte, error)
- func (p *InMem) Serve(ctx context.Context, subject string, handler Handler) (Subscription, error)
- func (p *InMem) Stream(ctx context.Context, subject string, ch chan<- []byte) (Subscription, error)
- type Messenger
- type SQLiteBus
- func (b *SQLiteBus) Close() error
- func (b *SQLiteBus) Publish(ctx context.Context, subject string, data []byte) error
- func (b *SQLiteBus) Request(ctx context.Context, subject string, data []byte) ([]byte, error)
- func (b *SQLiteBus) Serve(ctx context.Context, subject string, handler Handler) (Subscription, error)
- func (b *SQLiteBus) Stream(ctx context.Context, subject string, ch chan<- []byte) (Subscription, error)
- type SQLiteBusOptions
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnectionClosed = errors.New("connection closed") ErrStreamSubscriptionFail = errors.New("stream subscription failed") ErrMessagePublish = errors.New("message publishing failed") ErrRequestTimeout = errors.New("request timed out") ErrNoResponders = fmt.Errorf("%w: no handler was subscribed to the subject, so the request was never delivered and is safe to retry", ErrRequestTimeout) )
Functions ¶
func SetupNatsInstance ¶
Types ¶
type InMem ¶ added in v0.28.0
type InMem struct {
// contains filtered or unexported fields
}
type Messenger ¶
type Messenger interface {
Publish(ctx context.Context, subject string, data []byte) error
Stream(ctx context.Context, subject string, ch chan<- []byte) (Subscription, error)
Request(ctx context.Context, subject string, data []byte) ([]byte, error)
Serve(ctx context.Context, subject string, handler Handler) (Subscription, error)
Close() error
}
func NewTestPubSub ¶
type SQLiteBus ¶ added in v0.28.0
type SQLiteBus struct {
// contains filtered or unexported fields
}
func NewSQLiteWithOptions ¶ added in v0.28.0
func NewSQLiteWithOptions(exec sqlExec, opt SQLiteBusOptions) *SQLiteBus
type SQLiteBusOptions ¶ added in v0.28.0
type Subscription ¶
type Subscription interface {
Unsubscribe() error
}
Click to show internal directories.
Click to hide internal directories.