-
Notifications
You must be signed in to change notification settings - Fork 75
Conversation
server.go
Outdated
// FrontendHostPort returns the host:port for this server. | ||
func (s *Server) FrontendHostPort() string { | ||
return s.frontendHostPort | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For your use case, would a method to return client.Options
work as well?
Right now Temporalite really only needs a hostport to be set on the client, but in the future more client options may need to have modified default values and I would like to avoid confusion for end users about how to instantiate clients. I think this would make it possible to introspect things like hostport, but also decrease the chances that dependent code would break if/when Temporalite needs to further customize default client options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.Options
would work, though I might just be extracting the host:port out of it for some uses.
Codecov Report
@@ Coverage Diff @@
## main #11 +/- ##
==========================================
- Coverage 46.72% 46.57% -0.15%
==========================================
Files 11 11
Lines 625 627 +2
==========================================
Hits 292 292
- Misses 315 317 +2
Partials 18 18
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it a bit more and the simplicity of a function just to return the host:port feels nicer than returning the whole client options object. We can always add that later on if we need it.
Lgtm after the suggested doc comment update. Thanks!
Co-authored-by: Jacob LeGrone <[email protected]>
What changed?
Exposed
FrontendHostPort
Why?
Some uses of temporalite may want to use this value for their own client creation, or in my case, pass it somewhere else for their use.
Ideally this would be
FrontendAddr() net.Addr
and the system would support things like local unix paths and such, but I understand this is a Temporal server limitation too. I also considered just exposingFrontendPort
since127.0.0.1
is hardcoded, but I assumed it may not be hardcoded always andhost:port
can be directly passed to different forms ofDial
.How did you test it?
Untested getter.
Potential risks
None
Is hotfix candidate?
No