add ai cache plugin (#1010)

This commit is contained in:
澄潭
2024-05-29 21:10:22 +08:00
committed by GitHub
parent b00f79f3af
commit 812edf1490
10 changed files with 543 additions and 5 deletions

View File

@@ -151,3 +151,20 @@ func (c ConsulCluster) HostName() string {
}
return c.ServiceName
}
type FQDNCluster struct {
FQDN string
Host string
Port int64
}
func (c FQDNCluster) ClusterName() string {
return fmt.Sprintf("outbound|%d||%s", c.Port, c.FQDN)
}
func (c FQDNCluster) HostName() string {
if c.Host != "" {
return c.Host
}
return c.FQDN
}

View File

@@ -142,7 +142,9 @@ func RedisCall(cluster Cluster, respQuery []byte, callback RedisResponseCallback
}
}
}
callback(responseValue)
if callback != nil {
callback(responseValue)
}
})
if err != nil {
proxywasm.LogCriticalf("redis call failed, request-id: %s, error: %v", requestID, err)