api

package
v1.0.0-beta.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Represent an API object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartApi

func StartApi(serverAddr string)

Start a new API process

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) CreateSetup

func (a *API) CreateSetup(w http.ResponseWriter, r *http.Request)

func (*API) GetAgent

func (a *API) GetAgent(w http.ResponseWriter, r *http.Request)

Get a list of samples by id and checksum

func (*API) GetMetrics

func (a *API) GetMetrics(w http.ResponseWriter, r *http.Request)

func (*API) GetSampleResult

func (a *API) GetSampleResult(w http.ResponseWriter, r *http.Request)

func (*API) ListAgents

func (a *API) ListAgents(w http.ResponseWriter, r *http.Request)

Get a list of samples by id and checksum

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) SetupStatus

func (a *API) SetupStatus(w http.ResponseWriter, r *http.Request)

func (*API) UpdateAgent

func (a *API) UpdateAgent(w http.ResponseWriter, r *http.Request)

Register a new agent, and generate a secret.

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 CreateSetupRequest

type CreateSetupRequest struct {
	Email    string
	Password string
}

type ListAgentsResponse

type ListAgentsResponse struct {
	Id          string
	Name        string
	Description string
	Secret      string
	Tags        map[string]string
	UpdatedAt   time.Time
}

List sample response struct

type ListSampleResponse

type ListSampleResponse struct {
	Id          string
	Name        string
	Description string
	UpdatedAt   time.Time
	Kind        string
}

List sample response struct

type LoginRequest

type LoginRequest struct {
	Email    string
	Password string
}

type LoginResponse

type LoginResponse struct {
	AuthToken string `json:"AuthToken,omitempty"`
	Error     string `json:"Error,omitempty"`
}

type MetricResponse

type MetricResponse struct {
	MetricName string
	Labels     map[string]string
	Values     []MetricValueResponse
}

type MetricValueResponse

type MetricValueResponse struct {
	Value float64
	Time  int64
}

type PingResponse

type PingResponse struct {
	Pong    bool
	Version string
}

Response for ping req

type RegisterAgentRequest

type RegisterAgentRequest struct {
	Name        string
	Description string
	Tags        map[string]string
}

type RegisterAgentResponse

type RegisterAgentResponse struct {
	Secret string
}

type SetupStatusResponse

type SetupStatusResponse struct {
	Status bool
}

Response for ping req

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL