Documentation ¶
Overview ¶
Represent an API object
Index ¶
- func StartApi(serverAddr string)
- type API
- func (a *API) AgentGetSample(w http.ResponseWriter, r *http.Request)
- func (a *API) AgentListSamples(w http.ResponseWriter, r *http.Request)
- func (a *API) AgentPushMetrics(w http.ResponseWriter, r *http.Request)
- func (a *API) ListSamples(w http.ResponseWriter, r *http.Request)
- func (a *API) Login(w http.ResponseWriter, r *http.Request)
- func (a *API) Ping(w http.ResponseWriter, r *http.Request)
- func (a *API) RegisterAgent(w http.ResponseWriter, r *http.Request)
- func (a *API) RegisterSample(w http.ResponseWriter, r *http.Request)
- func (a *API) UpdateSample(w http.ResponseWriter, r *http.Request)
- func (a *API) VerifyToken(w http.ResponseWriter, r *http.Request)
- type ListSampleResponse
- type LoginRequest
- type LoginResponse
- type PingResponse
- type RegisterAgentRequest
- type RegisterAgentResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
Represent API object
func (*API) AgentGetSample ¶
func (a *API) AgentGetSample(w http.ResponseWriter, r *http.Request)
Get one sample from agent
func (*API) AgentListSamples ¶
func (a *API) AgentListSamples(w http.ResponseWriter, r *http.Request)
Get a list of samples by id and checksum
func (*API) AgentPushMetrics ¶
func (a *API) AgentPushMetrics(w http.ResponseWriter, r *http.Request)
Recieve new metrics from an agent
func (*API) ListSamples ¶
func (a *API) ListSamples(w http.ResponseWriter, r *http.Request)
Get a list of samples by id and checksum
func (*API) Login ¶
func (a *API) Login(w http.ResponseWriter, r *http.Request)
Generate a login session
func (*API) Ping ¶
func (a *API) Ping(w http.ResponseWriter, r *http.Request)
This method return Pong
func (*API) RegisterAgent ¶
func (a *API) RegisterAgent(w http.ResponseWriter, r *http.Request)
Register a new agent, and generate a secret.
func (*API) RegisterSample ¶
func (a *API) RegisterSample(w http.ResponseWriter, r *http.Request)
Generate a new sample
func (*API) UpdateSample ¶
func (a *API) UpdateSample(w http.ResponseWriter, r *http.Request)
Generate a new sample
func (*API) VerifyToken ¶
func (a *API) VerifyToken(w http.ResponseWriter, r *http.Request)
Get a list of samples by id and checksum
type ListSampleResponse ¶
type ListSampleResponse struct { Id string Name string Description string UpdatedAt time.Time Kind string }
List sample response struct
type LoginRequest ¶
type LoginResponse ¶
type RegisterAgentRequest ¶
type RegisterAgentResponse ¶
type RegisterAgentResponse struct {
Secret string
}
Click to show internal directories.
Click to hide internal directories.