Documentation
¶
Overview ¶
Package natsjs provides a NATS Jetstream implementation of the events.Stream interface.
Index ¶
- func NewStream(opts ...Option) (events.Stream, error)
- type Option
- func Address(addr string) Option
- func Authenticate(username, password string) Option
- func ClientID(id string) Option
- func ClusterID(id string) Option
- func DisableDurableStreams() Option
- func Logger(log logger.Logger) Option
- func MaxAge(age time.Duration) Option
- func MaxMsgSize(size int) Option
- func Name(name string) Option
- func NkeyConfig(nkey string) Option
- func RetentionPolicy(rp int) Option
- func SynchronousPublish(sync bool) Option
- func TLSConfig(t *tls.Config) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(o *Options)
Option is a function which configures options.
func Authenticate ¶
Authenticate authenticates the connection with the given username and password.
func ClientID ¶
ClientID sets the client id for the nats connection.
func ClusterID ¶
ClusterID sets the cluster id for the nats connection.
func DisableDurableStreams ¶
func DisableDurableStreams() Option
DisableDurableStreams will disable durable streams.
func NkeyConfig ¶
NkeyConfig string to use when connecting to the cluster.
func SynchronousPublish ¶
SynchronousPublish allows using a synchronous publishing instead of the default asynchronous.
type Options ¶
type Options struct {
ClusterID string
ClientID string
Address string
NkeyConfig string
TLSConfig *tls.Config
Logger logger.Logger
SyncPublish bool
Name string
DisableDurableStreams bool
Username string
Password string
RetentionPolicy int
MaxAge time.Duration
MaxMsgSize int
}
Options which are used to configure the nats stream.
Source Files
¶
- nats.go
- options.go
Click to show internal directories.
Click to hide internal directories.