MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / GetConfig

Method GetConfig

internal/home/client.go:516–533  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

514}
515
516func (c *Client) GetConfig(ctx context.Context) ([]byte, error) {
517 c.refreshBestClusterNode(ctx)
518 cmd, errClient := c.commandClient()
519 if errClient != nil {
520 return nil, errClient
521 }
522 raw, err := cmd.Get(ctx, redisKeyConfig).Bytes()
523 if errors.Is(err, redis.Nil) {
524 return nil, ErrConfigNotFound
525 }
526 if err != nil {
527 return nil, err
528 }
529 if len(raw) == 0 {
530 return nil, ErrEmptyResponse
531 }
532 return raw, nil
533}
534
535func (c *Client) GetModels(ctx context.Context, headers http.Header, query url.Values) ([]byte, error) {
536 cmd, errClient := c.commandClient()

Callers 1

StartConfigSubscriberMethod · 0.95

Calls 4

commandClientMethod · 0.95
BytesMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected