Documentation
¶
Overview ¶
Package natsclient configures how a NATS client identifies itself from command-line flags, and reports when its connection cannot recover.
Index ¶
Constants ¶
const DefaultAuthFailureGrace = 5 * time.Minute
DefaultAuthFailureGrace outlasts the kubelet's refresh of a mounted Secret, which by default takes up to its one-minute sync plus a one-minute cache TTL.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flags ¶
type Flags struct {
Creds string
Nkey string
TokenFile string
User string
PasswordFile string
Name string
InboxPrefix string
// AuthFailureGrace is how long the server may refuse the credential before
// Liveness fails. Zero means DefaultAuthFailureGrace.
AuthFailureGrace time.Duration
// contains filtered or unexported fields
}
Flags is how a NATS client identifies itself. Register binds each field to a flag; a field set beforehand becomes that flag's default.
type Liveness ¶
type Liveness struct {
// contains filtered or unexported fields
}
Liveness reports when a connection can no longer recover on its own: once it is closed, or once the server has kept refusing its credential for longer than the grace period without a connect in between. Reconnecting for any other reason stays healthy, so a NATS rollout does not restart the client.
IgnoreAuthErrorAbort keeps a client retrying a refused credential so it can pick up a rotated Secret. A credential still refused after the grace will not be replaced by a refresh, and a restart at least surfaces it.
func NewLiveness ¶
NewLiveness fails once the credential has been refused for longer than grace. Zero means DefaultAuthFailureGrace.