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

Method GetPluginTasks

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

Source from the content-addressed store, hash-verified

909}
910
911func (c *Client) GetPluginTasks(ctx context.Context) ([]PluginTask, error) {
912 cmd, errClient := c.commandClient()
913 if errClient != nil {
914 return nil, errClient
915 }
916 raw, errGet := cmd.Get(ctx, redisKeyPluginTasks).Bytes()
917 if errors.Is(errGet, redis.Nil) {
918 return nil, nil
919 }
920 if errGet != nil {
921 return nil, errGet
922 }
923 if len(raw) == 0 {
924 return nil, nil
925 }
926 var tasks []PluginTask
927 if errUnmarshal := json.Unmarshal(raw, &tasks); errUnmarshal != nil {
928 return nil, errUnmarshal
929 }
930 return tasks, nil
931}
932
933func (c *Client) handleSubscriptionPayload(ctx context.Context, channel string, payload string, onConfig func([]byte) error) error {
934 payload = strings.TrimSpace(payload)

Callers 2

Calls 3

commandClientMethod · 0.95
BytesMethod · 0.80
GetMethod · 0.45

Tested by 1