api

package
v1.0.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 13 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) 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 LoginRequest struct {
	Email    string
	Password string
}

type LoginResponse

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

type PingResponse

type PingResponse struct {
	Pong    bool
	Version string
}

Response for ping req

type RegisterAgentRequest

type RegisterAgentRequest struct {
	Tags map[string]string
}

type RegisterAgentResponse

type RegisterAgentResponse struct {
	Secret string
}

Jump to

Keyboard shortcuts

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