Documentation ¶
Overview ¶
Package api Represent an API object
Index ¶
- func StartAPI(serverAddr, dbtype 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) CreateSetup(w http.ResponseWriter, r *http.Request)
- func (a *API) DeleteSample(w http.ResponseWriter, r *http.Request)
- func (a *API) DisableTwoFaConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) GetAgent(w http.ResponseWriter, r *http.Request)
- func (api *API) GetMe(w http.ResponseWriter, r *http.Request)
- func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)
- func (a *API) GetSampleResult(w http.ResponseWriter, r *http.Request)
- func (a *API) ListAgents(w http.ResponseWriter, r *http.Request)
- func (a *API) ListSamples(w http.ResponseWriter, r *http.Request)
- func (a *API) ListScenariosSteps(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) SampleRunner(w http.ResponseWriter, r *http.Request)
- func (a *API) SetupStatus(w http.ResponseWriter, r *http.Request)
- func (a *API) SystemInfo(w http.ResponseWriter, r *http.Request)
- func (a *API) TwoFaConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) TwofactorQrcode(w http.ResponseWriter, r *http.Request)
- func (a *API) UpdateAgent(w http.ResponseWriter, r *http.Request)
- func (api *API) UpdatePassword(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 ListAgentsResponse
- type RegisterAgentRequest
- type RegisterAgentResponse
- type SetupStatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API Represent API object
func (*API) AgentGetSample ¶
func (a *API) AgentGetSample(w http.ResponseWriter, r *http.Request)
AgentGetSample is a handler that returns a sample of the agent
func (*API) AgentListSamples ¶
func (a *API) AgentListSamples(w http.ResponseWriter, r *http.Request)
AgentListSamples Get a list of samples by id and checksum
func (*API) AgentPushMetrics ¶
func (a *API) AgentPushMetrics(w http.ResponseWriter, r *http.Request)
AgentPushMetrics Receive new metrics from an agent
func (*API) CreateSetup ¶
func (a *API) CreateSetup(w http.ResponseWriter, r *http.Request)
CreateSetup is the handler to create a new setup
func (*API) DeleteSample ¶ added in v1.2.0
func (a *API) DeleteSample(w http.ResponseWriter, r *http.Request)
GetAgent is a function to get agent
func (*API) DisableTwoFaConfiguration ¶ added in v1.0.5
func (a *API) DisableTwoFaConfiguration(w http.ResponseWriter, r *http.Request)
TwofactorQrcode Generates a QR code for the user to scan to enable 2fa.
func (*API) GetAgent ¶
func (a *API) GetAgent(w http.ResponseWriter, r *http.Request)
GetAgent is a function to get agent
func (*API) GetMe ¶ added in v1.0.5
func (api *API) GetMe(w http.ResponseWriter, r *http.Request)
GetMe return user info of logged in user
func (*API) GetMetrics ¶
func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)
GetMetrics returns the metrics for the given namespace and name
func (*API) GetSampleResult ¶
func (a *API) GetSampleResult(w http.ResponseWriter, r *http.Request)
GetSampleResult is a handler to get a sample result
func (*API) ListAgents ¶
func (a *API) ListAgents(w http.ResponseWriter, r *http.Request)
ListAgents returns the list of agents
func (*API) ListSamples ¶
func (a *API) ListSamples(w http.ResponseWriter, r *http.Request)
ListSamples is a method to list samples
func (*API) ListScenariosSteps ¶
func (a *API) ListScenariosSteps(w http.ResponseWriter, r *http.Request)
ListScenariosSteps returns a list of all the steps of all the scenarios
func (*API) Login ¶
func (a *API) Login(w http.ResponseWriter, r *http.Request)
Login is the handler for the login endpoint
func (*API) Ping ¶
func (a *API) Ping(w http.ResponseWriter, r *http.Request)
Ping is a simple ping endpoint
func (*API) RegisterAgent ¶
func (a *API) RegisterAgent(w http.ResponseWriter, r *http.Request)
RegisterAgent register a new agent
func (*API) RegisterSample ¶
func (a *API) RegisterSample(w http.ResponseWriter, r *http.Request)
RegisterSample is a function to register a sample
func (*API) SampleRunner ¶
func (a *API) SampleRunner(w http.ResponseWriter, r *http.Request)
func (*API) SetupStatus ¶
func (a *API) SetupStatus(w http.ResponseWriter, r *http.Request)
SetupStatus returns the status of the setup
func (*API) SystemInfo ¶
func (a *API) SystemInfo(w http.ResponseWriter, r *http.Request)
SystemInfo is the response of the system info
func (*API) TwoFaConfiguration ¶ added in v1.0.5
func (a *API) TwoFaConfiguration(w http.ResponseWriter, r *http.Request)
TwofactorQrcode Generates a QR code for the user to scan to enable 2fa.
func (*API) TwofactorQrcode ¶ added in v1.0.5
func (a *API) TwofactorQrcode(w http.ResponseWriter, r *http.Request)
TwofactorQrcode Generates a QR code for the user to scan to enable 2fa.
func (*API) UpdateAgent ¶
func (a *API) UpdateAgent(w http.ResponseWriter, r *http.Request)
UpdateAgent update agent
func (*API) UpdatePassword ¶ added in v1.0.5
func (api *API) UpdatePassword(w http.ResponseWriter, r *http.Request)
UpdatePassword update password
func (*API) UpdateSample ¶
func (a *API) UpdateSample(w http.ResponseWriter, r *http.Request)
UpdateSample is a function to update a sample
func (*API) VerifyToken ¶
func (a *API) VerifyToken(w http.ResponseWriter, r *http.Request)
VerifyToken is a handler function that verifies the validity of a token.
type ListAgentsResponse ¶
type ListAgentsResponse struct { ID string Name string Description string Secret string Tags map[string]string UpdatedAt time.Time }
ListAgentsResponse is the response of the list agents
type RegisterAgentRequest ¶
RegisterAgentRequest is the request to register a new agent
type RegisterAgentResponse ¶
type RegisterAgentResponse struct {
Secret string
}
RegisterAgentResponse is the response of RegisterAgent
type SetupStatusResponse ¶
type SetupStatusResponse struct {
Status bool
}
SetupStatusResponse is the response of the setup status
Source Files ¶
- 2fa_qrcode.go
- agent_get_sample.go
- agent_list_samples.go
- agent_push_metrics.go
- api.go
- configure_2fa.go
- create_setup.go
- delete_sample.go
- disable_2fa.go
- get_agent.go
- get_me.go
- get_metrics.go
- get_sample_result.go
- list_agents.go
- list_samples.go
- list_scenarios_steps.go
- login.go
- ping.go
- register_agent.go
- register_sample.go
- sample_runner.go
- setup_status.go
- system_info.go
- update_agent.go
- update_password.go
- update_sample.go
- verify_token.go