mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
b80e0a102d
Allow queries targeted by hostname and label name.
24 lines
602 B
Go
24 lines
602 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func decodeCreateDistributedQueryCampaignRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
|
var req createDistributedQueryCampaignRequest
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
return nil, err
|
|
}
|
|
return req, nil
|
|
}
|
|
|
|
func decodeCreateDistributedQueryCampaignByNamesRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
|
var req createDistributedQueryCampaignByNamesRequest
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
return nil, err
|
|
}
|
|
return req, nil
|
|
}
|