Categorygithub.com/meinside/stan-client-go
modulepackage
0.0.25
Repository: https://github.com/meinside/stan-client-go.git
Documentation: pkg.go.dev

# README

stan-client-go

A wrapper for NATS Streaming Server (STAN).

It will (not perfectly, but try hard to) handle connection recoveries to STAN servers

and make publshing/consuming messages a little easier.

How to get

$ go get -u github.com/meinside/stan-client-go

Example

See the examples here.

TODO

  • Fix possible goroutine leaks on disconnects
  • Add more utility functions
  • Support more connection/subscription options
  • Add test codes

License

MIT

# Packages

No description provided by the author

# Functions

AuthOptionWithToken returns a pointer to AuthOption with token.
AuthOptionWithUsernameAndPassword returns a pointer to AuthOption with username and password.
Connect establishes connection to stan servers natsServers: array of NATS URLs natsAuthOption: nil if none natsSecOption: nil if none stanClusterID: cluster ID of STAN stanClientID: client ID of STAN subscriptions: array of subscriptions to subscribe messageHandler: callback function for message handling asyncPublishFailureHandler: callback function for handling failures of PublishAsync function logger: logger interface for logging.
SecOptionWithCerts returns a pointer to SecOption with certification files' locations.

# Structs

AuthOption for authentication.
Client for publish/subscribe with STAN servers.
SecOption for security (TLS).
ToSubscribe struct for subscription request.

# Interfaces

Logger interface for logging.