Documentation ¶
Index ¶
- Constants
- type APIClient
- func (client *APIClient) Delete(url string) (int, []byte, error)
- func (client *APIClient) Get(url string) (int, []byte, error)
- func (client *APIClient) GetService(name string) (resp model.IdempotentServiceParam, status int, err error)
- func (client *APIClient) Post(url string, body interface{}) (int, []byte, error)
- func (client *APIClient) PostService(name string, req PostServiceReq) (service model.Service, status int, err error)
- func (client *APIClient) Put(url string, body interface{}) (int, []byte, error)
- func (client *APIClient) PutService(name string, req model.IdempotentServiceParam) (resp PutServiceResp, status int, err error)
- type APIHandler
- type PostServiceReq
- type PutServiceResp
- type Server
Constants ¶
View Source
const (
// ServiceURI is uri prefix for service resources.
ServiceURI = "services"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient is client for ctlapi.
func (*APIClient) GetService ¶
func (client *APIClient) GetService(name string) (resp model.IdempotentServiceParam, status int, err error)
GetService calls GET service.
func (*APIClient) PostService ¶
func (client *APIClient) PostService(name string, req PostServiceReq) (service model.Service, status int, err error)
PostService calls POST service.
func (*APIClient) PutService ¶
func (client *APIClient) PutService(name string, req model.IdempotentServiceParam) (resp PutServiceResp, status int, err error)
PutService calls PUT service.
type APIHandler ¶
type APIHandler func(w http.ResponseWriter, r *http.Request, param httprouter.Params, body []byte)
APIHandler is common HTTP handler type.
type PostServiceReq ¶
type PostServiceReq struct {
Protocol string `json:"protocol"`
}
PostServiceReq is the request type of POST service method.
type PutServiceResp ¶
type PutServiceResp struct {
Changed bool `json:"changed"`
}
PutServiceResp is theresponse type of PUT service method.
Click to show internal directories.
Click to hide internal directories.