controllers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllDefinitions

func AllDefinitions(c *gin.Context)

AllDefinitions godoc

@Summary		Get all the definitions
@Description	Gets a list of all definitions
@ID				all-definitions
@Tags			definitions
@Security		ApiKeyAuth
@param			Authorization	header	string	true	"Authorization"
@Produce		json
@Success		200	array		definitions.Endpoint
@Failure		500	{object}	ErrorResponse
@Router			/definitions [get]

func AllReports

func AllReports(c *gin.Context)

AllReports godoc

@Summary		Get all the reports
@Description	Gets a list of all reports that can be filtered with a query
@ID				all-reports
@Tags			reports
@Produce		json
@Param			where	query		string	false	"Query in the format: field.op.value (optional)"
@Param			format	query		string	false	"Return format: json or csv (default: json)"
@Success		200		array		pipeline.Report
@Failure		500		{object}	ErrorResponse
@Router			/reports [get]

func CreateDefinition

func CreateDefinition(c *gin.Context)

CreateDefinition godoc

@Summary		Create a definition
@Description	Creates a new definition
@ID				create-definition
@Tags			definitions
@Security		ApiKeyAuth
@param			Authorization	header	string	true	"Authorization"
@Accept			json
@Produce		json
@Param			definition	body		definitions.Endpoint	true	"Endpoint definition"
@Success		200			{object}	definitions.Endpoint
@Failure		400			{object}	ErrorResponse
@Failure		500			{object}	ErrorResponse
@Router			/definitions [post]

func Definition

func Definition(c *gin.Context)

Definition godoc

@Summary		Get one definition
@Description	Gets a single definition identified by his endpoint name
@ID				definition
@Tags			definitions
@Security		ApiKeyAuth
@param			Authorization	header	string	true	"Authorization"
@Produce		json
@Param			name	path		string	true	"Bluetooth"
@Success		200		{object}	definitions.Endpoint
@Failure		404		{object}	ErrorResponse
@Failure		500		{object}	ErrorResponse
@Router			/definitions/:name [get]

func GetHealth

func GetHealth(c *gin.Context)

GetHealth godoc

@Summary		Health check
@Description	Get the health status of the API
@ID				health
@Tags			health
@Produce		json
@Success		200
@Router			/health [get]

func LoginUser added in v1.1.0

func LoginUser(c *gin.Context)

LoginUser godoc

@Summary		Logs a user in
@Schemes		LoginRequest LoginResponse ErrorResponse
@Description	Logs a user in using the provided credentials
@ID				login-user
@Tags			authentication
@Accept			application/json
@Produces		application/json
@Param			data	body		LoginRequest	true	"content"
@Success		200		{object}	LoginResponse
@Failure		400		{object}	ErrorResponse
@Failure		401		{object}	ErrorResponse
@Failure		500		{object}	ErrorResponse
@Router			/login [post]

func Report

func Report(c *gin.Context)

Report godoc

@Summary		Get one report
@Description	Gets a single report identified by his id
@ID				report
@Tags			reports
@Produce		json
@Param			format	query		string	false	"json"
@Param			id		path		string	true	"qNg8rJX"
@Success		200		{object}	pipeline.Report
@Failure		404		{object}	ErrorResponse
@Failure		500		{object}	ErrorResponse
@Router			/reports/:id [get]

func Ws

func Ws(c *gin.Context)

Ws godoc

@Summary		Open a websocket connection to receive notifications
@Description	Connect to this endpoint with the ws:// protocol to instantiate a websocket connection to get updates for new reports
@ID				ws
@Tags			reports
@Success		101
@Router			/ws [get]

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

type LoginRequest added in v1.1.0

type LoginRequest struct {
	Username string `json:"username" validation:"required"`
	Password string `json:"password" validation:"required"`
}

type LoginResponse added in v1.1.0

type LoginResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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