chore: store status

This commit is contained in:
xuu
2024-03-24 15:19:26 -06:00
parent 49bb6cbaea
commit bf54728f21
20 changed files with 760 additions and 147 deletions

View File

@@ -1,9 +0,0 @@
# extend type Query{
# namespaces: [String!]!
# keys(namespace: String!) [String!]!
# get(namespace: String! keys: [String!]) [String]!
# }
# extend type Mutation{
# set(namespace: String! key: String! value: String): Bool!
# }

View File

@@ -1 +0,0 @@
package mercury

View File

@@ -98,15 +98,16 @@ func (s *service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var requests []*Request
s.state.Use(r.Context(), func(ctx context.Context, state *state) error {
for id, p := range state.peers {
fmt.Fprintln(w, "PEER:", id[24:], p.Owner, p.Name)
}
if pickID != "" {
if rq, ok := state.requests[pickID]; ok {
requests = append(requests, rq)
}
} else {
for id, p := range state.peers {
fmt.Fprintln(w, "PEER:", id[24:], p.Owner, p.Name)
}
requests = make([]*Request, 0, len(state.requests))
for i := range state.requests {
rq := state.requests[i]