MCPcopy Index your code
hub / github.com/coder/coder / applyPortOffset

Method applyPortOffset

scripts/develop/main.go:318–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316}
317
318func (c *devConfig) applyPortOffset() {
319 c.portOffset = 0
320 if !c.portOffsetEnabled {
321 return
322 }
323 c.portOffset = portOffset(c.projectRoot)
324 if c.portExplicit.api {
325 c.apiPortSource = portSourceExplicit
326 } else {
327 c.apiPortSource = c.applyDefaultPortOffset(&c.apiPort)
328 }
329 if c.portExplicit.web {
330 c.webPortSource = portSourceExplicit
331 } else {
332 c.webPortSource = c.applyDefaultPortOffset(&c.webPort)
333 }
334 if c.portExplicit.proxy {
335 c.proxyPortSource = portSourceExplicit
336 } else {
337 c.proxyPortSource = c.applyDefaultPortOffset(&c.proxyPort)
338 }
339 if c.portExplicit.metrics {
340 c.metricsPortSource = portSourceExplicit
341 } else {
342 c.metricsPortSource = c.applyDefaultPortOffset(&c.coderMetricsPort)
343 }
344}
345
346func (c *devConfig) applyDefaultPortOffset(port *int64) portSource {
347 if c.portOffset == 0 {

Calls 2

portOffsetFunction · 0.85