chore: store status
This commit is contained in:
@@ -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!
|
||||
# }
|
||||
@@ -1 +0,0 @@
|
||||
package mercury
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user