Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*opts)
func WithClientCert ¶
func WithConnectionName ¶
func WithLogger ¶
func WithRootCA ¶
func WithTimeout ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a NATS object notification writer. It handles NATS JetStream connections and allows sending string representation of the address to the NATS server.
For correct operation must be created via New function. new(Writer) or Writer{} construction leads to undefined behaviour and is not safe.
func (*Writer) Connect ¶
Connect tries to connect to a specified NATS endpoint.
Connection is closed when passed context is done.
func (*Writer) Notify ¶
Notify sends object address's string representation to the provided topic. Uses first 4 bytes of object ID as a message ID to support 'exactly once' message delivery.
Returns error only if: 1. underlying connection was closed and has not been established again; 2. NATS server could not respond that it has saved the message.