Documentation ¶
Index ¶
- Constants
- func ClusterPanic(err error)
- func HandleAPIError(w http.ResponseWriter, r *http.Request, code int, err error)
- func RegisterAPIs(apiGroup *Group)
- func UnregisterAPIs(group string)
- type ChangeRequest
- type Entry
- type Err
- type FilterMeta
- type Group
- type ListMembersResp
- type ProfileStatusResponse
- type Server
- type StartProfilingRequest
Constants ¶
View Source
const ( // APIPrefix is the prefix of api. APIPrefix = "/apis/v1" // ConfigVersionKey is the key of header for config version. ConfigVersionKey = "X-Config-Version" )
View Source
const ( // CustomDataKindPrefix is the URL prefix of APIs for custom data kind CustomDataKindPrefix = "/customdatakinds" // CustomDataPrefix is the URL prefix of APIs for custom data CustomDataPrefix = "/customdata/{kind}" )
View Source
const ( // MetadataPrefix is the metadata prefix. MetadataPrefix = "/metadata" // ObjectMetadataPrefix is the object metadata prefix. ObjectMetadataPrefix = "/metadata/objects" // FilterMetaPrefix is the filter of HTTPPipeline metadata prefix. FilterMetaPrefix = "/metadata/objects/httppipeline/filters" )
View Source
const ( // ObjectPrefix is the object prefix. ObjectPrefix = "/objects" // ObjectKindsPrefix is the object-kinds prefix. ObjectKindsPrefix = "/object-kinds" // StatusObjectPrefix is the prefix of object status. StatusObjectPrefix = "/status/objects" )
View Source
const ( // ProfilePrefix is the URL prefix of profile APIs ProfilePrefix = "/profile" // StartAction is the URL for starting profiling StartAction = "start" // StopAction is the URL for stopping profiling StopAction = "stop" )
Variables ¶
This section is empty.
Functions ¶
func ClusterPanic ¶
func ClusterPanic(err error)
ClusterPanic panics because of the cluster-level fault.
func HandleAPIError ¶
HandleAPIError handles api error.
func RegisterAPIs ¶ added in v1.1.0
func RegisterAPIs(apiGroup *Group)
RegisterAPIs registers global admin APIs.
func UnregisterAPIs ¶ added in v1.1.0
func UnregisterAPIs(group string)
UnregisterAPIs unregisters the API group.
Types ¶
type ChangeRequest ¶ added in v1.5.0
type ChangeRequest struct { Rebuild bool `yaml:"rebuild"` Delete []string `yaml:"delete"` List []customdata.Data `yaml:"list"` }
ChangeRequest represents a change request to custom data
type Entry ¶ added in v1.2.0
type Entry struct { Path string `yaml:"path"` Method string `yaml:"method"` Handler http.HandlerFunc `yaml:"-"` }
Entry is the entry of API.
type FilterMeta ¶
FilterMeta is the metadata of filter.
type ListMembersResp ¶
type ListMembersResp []cluster.MemberStatus
ListMembersResp is the response of list member.
func (ListMembersResp) Len ¶
func (r ListMembersResp) Len() int
func (ListMembersResp) Less ¶
func (r ListMembersResp) Less(i, j int) bool
func (ListMembersResp) Swap ¶
func (r ListMembersResp) Swap(i, j int)
type ProfileStatusResponse ¶ added in v1.5.1
type ProfileStatusResponse struct { CPUPath string `yaml:"cpuPath"` MemoryPath string `yaml:"memoryPath"` }
ProfileStatusResponse contains cpu and memory profile file paths
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the api server.
func MustNewServer ¶
func MustNewServer(opt *option.Options, cls cluster.Cluster, super *supervisor.Supervisor, profile pprof.Profile) *Server
MustNewServer creates an api server.
type StartProfilingRequest ¶ added in v1.5.1
type StartProfilingRequest struct {
Path string `yaml:"path"`
}
StartProfilingRequest contains file path to profile file
Click to show internal directories.
Click to hide internal directories.