package
2.1.2+incompatible
Repository: https://github.com/asiffer/netspot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

APIError inits a new error from a string message.
APIErrorf inits a new error with string formatting support.
APIErrorFromMsg generates the error from an input error message.
ConfigGetHandler returns the current config @Summary Get the config of the IDS @Description You can fetch the netspot config through this endpoint @Accept json @Produce json @Success 200 {object} string "Acknowledge message" @Failure 400 {object} apiError "Error message" @Failure 405 {object} apiError "Error message" @Failure 500 {object} apiError "Error message" @Router /config [get].
ConfigPostHandler update the IDS config @Summary Update the config of the IDS @Description You can update the netspot config through this endpoint @Accept json @Produce plain,json @Param config body map[string]string true "Input config" @Success 201 {string} string "Acknowledge message" @Failure 400 {object} apiError "Error message" @Failure 405 {object} apiError "Error message" @Failure 500 {object} apiError "Error message" @Router /config [post].
DashboardHandler serves the dashboard.
DevicesHandler returns the list of available interfaces @Summary List the available devices @Description This returns the list of the network interfaces that can be monitored @Accept json @Produce json @Success 200 {array} string "list of the available devices" @Failure 500 {object} apiError "error message" @Router /devices [get].
InitConfig prepare the API according to the config file In particular, it initializes the server but does not start to listen.
InitLogger initialize the sublogger for API.
LoggingMiddleware logs the incoming HTTP request & its duration.
PingHandler responds to ping requests @Summary Server healthcheck @Description This endpoints basically aims to check if the server is up @Accept json @Success 200 @Failure 405 {object} apiError "Error message" @Router /ping [get].
RunHandler manages start/stop actions @Summary Manage the IDS status @Description Use this path to start/stop the IDS @Accept json @Produce json @Param action body string false "the action to perform" Enums("start", "stop") @Success 200 {string} string "Comment about the action performed" @Failure 400 {object} apiError "Error message" @Router /run [post].
@title Netspot API @version 2.1.1 @description Netspot as a service @termsOfService http://swagger.io/terms/ @contact.name API Support @contact.email [email protected] @license.name GPLv3 @license.url https://www.gnu.org/licenses/gpl-3.0.en.html @host localhost:11000 @BasePath /api @Schemes http.
StatsHandler returns the list of the available stats along with their description @Summary List the available statistics @Description This returns the list of the statistics than can be loaded @Accept json @Produce json @Header 200 {string} Content-Type "application/json" @Success 200 {object} map[string]string "Available statistics along with their description" @Failure 500 {object} apiError "error message" @Router /stats [get].

# Structs

BadMethodHandler catches requests with Bad methods.