Documentation ¶
Index ¶
- func NewEmbeddedServer(ctx context.Context) (string, error)
- type Client
- type Config
- type INats
- type JetStream
- func (j *JetStream) CreateKeyValue(ctx context.Context, bucket string) (*KV, error)
- func (j *JetStream) Publish(ctx context.Context, request PublishRequest) error
- func (j *JetStream) Subscribe(ctx context.Context, channel string) (broker.ISubscription, error)
- func (j *JetStream) UnSubscribe(ctx context.Context, s broker.ISubscription) error
- type JetStreamSubscription
- type KV
- type PubSub
- type PubSubSubscription
- type PublishRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the connection to NATS
type INats ¶
type INats interface { Publish(ctx context.Context, publishRequest PublishRequest) error Subscribe(ctx context.Context, channel string) (broker.ISubscription, error) UnSubscribe(ctx context.Context, s broker.ISubscription) error }
INats is an interface over nats pubsub and jetstream
type JetStream ¶
type JetStream struct {
// contains filtered or unexported fields
}
JetStream ...
func NewJetStream ¶
NewJetStream returns nats NewJetStream
func (*JetStream) CreateKeyValue ¶
CreateKeyValue for NATS
func (*JetStream) Publish ¶
func (j *JetStream) Publish(ctx context.Context, request PublishRequest) error
Publish data to the subject
func (*JetStream) UnSubscribe ¶
UnSubscribe from jetstream topic
type JetStreamSubscription ¶
type JetStreamSubscription struct { broker.BaseSubscription JetStream // contains filtered or unexported fields }
JetStreamSubscription ...
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV struct for NATS
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub provides nats pubsub implementation
func (PubSub) Publish ¶
func (s PubSub) Publish(ctx context.Context, request PublishRequest) error
Publish data to the subject
func (PubSub) UnSubscribe ¶
UnSubscribe a subscriber
type PubSubSubscription ¶
type PubSubSubscription struct { broker.BaseSubscription // contains filtered or unexported fields }
PubSubSubscription ...
type PublishRequest ¶
PublishRequest is the publishRequest
Click to show internal directories.
Click to hide internal directories.