Skip to content

Commit

Permalink
Add settable id for nats context options (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelattwood authored Jun 13, 2024
1 parent 91df8f4 commit 66c18d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion surveyor/conn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type natsContext struct {
TLSKey string `json:"tls_key"`

// only passed programmatically
NatsOpts []nats.Option `json:"-"`
NatsOptsID string `json:"nats_opts_id"`
NatsOpts []nats.Option `json:"-"`
}

func (c *natsContext) copy() *natsContext {
Expand Down
3 changes: 3 additions & 0 deletions surveyor/jetstream_advisories.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ type JSAdvisoryConfig struct {
// optional configuration for importing JS metrics and advisories from other accounts
ExternalAccountConfig *JSAdvisoriesExternalAccountConfig `json:"-"`

// unique identifier for set of NATS options, to permit reload on change
NatsOptsID string `json:"nats_opts_id"`
// nats options appended to base surveyor options
NatsOpts []nats.Option `json:"-"`
}
Expand Down Expand Up @@ -391,6 +393,7 @@ func (o *jsAdvisoryListener) natsContext() *natsContext {
TLSCA: o.config.TLSCA,
TLSCert: o.config.TLSCert,
TLSKey: o.config.TLSKey,
NatsOptsID: o.config.NatsOptsID,
NatsOpts: o.config.NatsOpts,
}

Expand Down
3 changes: 3 additions & 0 deletions surveyor/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ type ServiceObsConfig struct {
// optional configuration for importing observations from other accounts
ExternalAccountConfig *ServiceObservationExternalAccountConfig `json:"-"`

// unique identifier for set of NATS options, to permit reload on change
NatsOptsID string `json:"nats_opts_id"`
// nats options appended to base surveyor options
NatsOpts []nats.Option `json:"-"`
}
Expand Down Expand Up @@ -266,6 +268,7 @@ func (o *serviceObsListener) natsContext() *natsContext {
TLSCA: o.config.TLSCA,
TLSCert: o.config.TLSCert,
TLSKey: o.config.TLSKey,
NatsOptsID: o.config.NatsOptsID,
NatsOpts: o.config.NatsOpts,
}

Expand Down

0 comments on commit 66c18d6

Please sign in to comment.