MCPcopy Index your code
hub / github.com/celer-pkg/celer / SetProxyHost

Method SetProxyHost

configs/celer_update.go:295–318  ·  view source on GitHub ↗
(host string)

Source from the content-addressed store, hash-verified

293}
294
295func (c *Celer) SetProxyHost(host string) error {
296 if strings.TrimSpace(host) == "" {
297 return fmt.Errorf("proxy host is invalid")
298 }
299
300 if err := c.readOrCreate(); err != nil {
301 return err
302 }
303
304 if c.configData.Proxy == nil {
305 c.configData.Proxy = &Proxy{
306 Host: host,
307 Port: 0,
308 }
309 } else {
310 c.configData.Proxy.Host = host
311 }
312
313 if err := c.save(); err != nil {
314 return err
315 }
316
317 return nil
318}
319
320func (c *Celer) SetProxyPort(port int) error {
321 if port <= 0 {

Callers 1

configureProxyMethod · 0.80

Calls 2

readOrCreateMethod · 0.95
saveMethod · 0.95

Tested by

no test coverage detected