endpoints

package
v0.0.0-...-3356bae Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: LGPL-2.1 Imports: 14 Imported by: 0

README

This package holds the files for API endpoint registration and related handlers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepObtainUserDid

func DepObtainUserDid(ctx iris.Context) dto.InjectedParam

DepObtainUserDid this tries to get the user DID store in the previously generated auth Bearer token.

Types

type DronesHandler

type DronesHandler struct {
	// contains filtered or unexported fields
}

DronesHandler endpoint handler struct for Drones

func NewDronesHandler

func NewDronesHandler(app *iris.Application, mdwAuthChecker *context.Handler, svcR *utils.SvcResponse, svcC *utils.SvcConfig) DronesHandler

NewDronesHandler create and register the handler for Drones

- app *iris.Application ~ Iris App instance

- MdwAuthChecker *context.Handler ~ Authentication checker middleware

- svcR *utils.SvcResponse ~ GrantIntentResponse service instance

- svcC utils.SvcConfig ~ Configuration service instance

func (DronesHandler) CheckingLoadedMedicationItems

func (h DronesHandler) CheckingLoadedMedicationItems(ctx iris.Context)

CheckingLoadedMedicationItems checking loaded medication items for a given drone @Summary Checking loaded medication items for a given drone @description.markdown CheckingLoadedMedicationsItemsDescription @Tags medications @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Param serialNumber path string true "Serial number of a drone" Format(string) @Success 200 {object} []string "OK" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /medications/items/{serialNumber} [get]

func (DronesHandler) GetADrone

func (h DronesHandler) GetADrone(ctx iris.Context)

GetADrone get a drone @Summary Get a drone by serialNumber @description.markdown GetADroneDescription @Tags drones @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Param serialNumber path string true "Serial number of a drone" Format(string) @Success 200 {object} dto.Drone "OK" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /drones/{serialNumber} [get]

func (DronesHandler) GetDrones

func (h DronesHandler) GetDrones(ctx iris.Context)

GetDrones get drones @Summary Get drones @description.markdown GetDronesDescription @Tags drones @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Param state query int false "drone state" Enums(0, 1, 2, 3, 4, 5) @Success 200 {object} []dto.Drone "OK" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /drones [get]

func (DronesHandler) GetMedications

func (h DronesHandler) GetMedications(ctx iris.Context)

GetMedications get medications @Summary Get medications @description.markdown GetMedicationsDescription @Tags medications @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Success 200 {object} []dto.Medication "OK" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /medications [get]

func (DronesHandler) LoadMedicationItems

func (h DronesHandler) LoadMedicationItems(ctx iris.Context)

LoadMedicationItems load a drone with medication items @Summary Load a drone with medication items @description.markdown LoadMedicationItemsDescription @Tags medications @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Param serialNumber path string true "Serial number of a drone" Format(string) @Param medicationItemCodes body []string true "Medication item codes' collection" @Success 204 "OK" @Failure 401 {object} dto.Problem "err.unauthorized" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /medications/items/{serialNumber} [post]

func (DronesHandler) PopulateDB

func (h DronesHandler) PopulateDB(ctx iris.Context)

PopulateDB @Summary Populate the database with fake data @description.markdown PopulateDbDescription @Tags database @Accept json @Produce json @Success 204 "OK" @Failure 401 {object} dto.Problem "err.unauthorized" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /database/populate [post]

func (DronesHandler) RegisterADrone

func (h DronesHandler) RegisterADrone(ctx iris.Context)

RegisterADrone registers a new drone @Summary Registers a new drone, also updates a previously inserted drone @description.markdown RegisterADroneDescription @Tags drones @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Param drone body dto.RequestDrone true "Drone data" @Success 204 "OK" @Failure 401 {object} dto.Problem "err.unauthorized" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /drones [post]

func (DronesHandler) StatusServer

func (h DronesHandler) StatusServer(ctx iris.Context)

type EventLogHandler

type EventLogHandler struct {
	// contains filtered or unexported fields
}

EventLogHandler endpoint handler struct for EventLog

func NewEventLogHandler

func NewEventLogHandler(app *iris.Application, mdwAuthChecker *context.Handler, svcR *utils.SvcResponse, svcC *utils.SvcConfig) EventLogHandler

NewEventLogHandler create and register the handler for EventLog

- app *iris.Application ~ Iris App instance

- MdwAuthChecker *context.Handler ~ Authentication checker middleware

- svcR *utils.SvcResponse ~ GrantIntentResponse service instance

- svcC utils.SvcConfig ~ Configuration service instance

func (EventLogHandler) GetEventLog

func (h EventLogHandler) GetEventLog(ctx iris.Context)

GetEventLog get event logs @Summary Get event logs @description.markdown GetEventLogDescription @Tags logs @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Insert access token" default(Bearer <Add access token here>) @Success 200 {object} []dto.LogEvent "OK" @Failure 400 {object} dto.Problem "err.processing_param" @Failure 500 {object} dto.Problem "err.database_related" @Failure 504 {object} dto.Problem "err.network" @Router /logs [get]

type HAuth

type HAuth struct {
	// contains filtered or unexported fields
}

func NewAuthHandler

func NewAuthHandler(app *iris.Application, mdwAuthChecker *context.Handler, svcR *utils.SvcResponse, svcC *utils.SvcConfig) HAuth

NewAuthHandler create and register the authentication handlers for the App. For the moment, all the auth handlers emulates the Oauth2 "password" grant-type using the "client-credentials" flow.

- app *iris.Application ~ Iris App instance

- MdwAuthChecker *context.Handler ~ Authentication checker middleware

- svcR *utils.SvcResponse ~ GrantIntentResponse service instance

- svcC utils.SvcConfig ~ Configuration service instance

Jump to

Keyboard shortcuts

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