/
request.go
38 lines (33 loc) · 1.33 KB
/
request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package model
import (
"net/http"
)
// RequestParams describes the params passed down in every request
type RequestParams struct {
RequestID string `json:"requestId"`
Resource string `json:"resource"`
Op string `json:"op"`
Attributes map[string]string `json:"attributes"`
Headers http.Header `json:"headers"`
Claims map[string]interface{} `json:"claims"`
Method string `json:"method"`
Path string `json:"path"`
Payload interface{} `json:"payload"`
}
// SpecObject describes the basic structure of config specifications
type SpecObject struct {
API string `json:"api" yaml:"api"`
Type string `json:"type" yaml:"type"`
Meta map[string]string `json:"meta" yaml:"meta"`
Spec interface{} `json:"spec" yaml:"spec,omitempty"`
}
// BatchSpecApplyRequest body of batch config apply endpoint
type BatchSpecApplyRequest struct {
Specs []*SpecObject `json:"specs" yaml:"specs"`
}
// LicenseUpgradeRequest is the body of license upgrade request
type LicenseUpgradeRequest struct {
LicenseKey string `json:"licenseKey" mapstructure:"licenseKey"`
LicenseValue string `json:"licenseValue" mapstructure:"licenseValue"`
ClusterName string `json:"clusterName" mapstructure:"clusterName"`
}