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

Method handleSubscriptionPayload

internal/home/client.go:933–950  ·  view source on GitHub ↗
(ctx context.Context, channel string, payload string, onConfig func([]byte) error)

Source from the content-addressed store, hash-verified

931}
932
933func (c *Client) handleSubscriptionPayload(ctx context.Context, channel string, payload string, onConfig func([]byte) error) error {
934 payload = strings.TrimSpace(payload)
935 if payload == "" {
936 return nil
937 }
938
939 switch strings.ToLower(strings.TrimSpace(channel)) {
940 case redisChannelConfig:
941 if onConfig == nil {
942 return nil
943 }
944 return onConfig([]byte(payload))
945 case redisChannelCluster:
946 return c.updateClusterNodesFromPayload([]byte(payload))
947 default:
948 return nil
949 }
950}
951
952// StartConfigSubscriber connects to home, fetches config once via GET config, then subscribes to
953// the "config" channel to receive runtime config updates.

Callers 1

StartConfigSubscriberMethod · 0.95

Calls 1

Tested by

no test coverage detected