api

package
v0.0.0-...-51fd5d7 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(serviceNumber int) service.Service

Types

type API

type API struct {
	service.Tools
	// AmqpConn is the amqp connection.
	AmqpConn *amqp.Conn
	// Postgresql handler.
	PG *pg.PG
	// Influx is the influxdb client.
	Influx *influxdb.Client
	// Cache is the cache handler.
	Cache *cache.Cache
	// Gin web fremework engine.
	Router *gin.Engine
	// Auth handler.
	Auth *auth.Auth
	// Validator.
	Validate *validator.Validate
	// User pw hash cost.
	UserPWBcryptCost int
	// Logger is the internal logger.
	Log *logger.Logger
	// Counter is the request counter.
	Counter *counter.Counter
	// Group is an singleflight group to use across the
	// http requests.
	Group singleflight.Group

	// ServerRTSP is the reverse proxy RTSP server.
	ServerRTSP *proxyrtsp.Server
	// ProxyRTSP is the reverse proxy RTSP manager.
	// ProxyRTSP *proxyrtsp.Proxy
	// WebSocketManager is the web socket connection manager.
	WebSocket *websocket.Manager
	// contains filtered or unexported fields
}

func (*API) Close

func (api *API) Close() error

func (*API) CreateTrapListener

func (api *API) CreateTrapListener(tl models.TrapListener)

CreateTrapListener assumes that the trap listener is was created on database and run the listener.

func (*API) DeleteTrapListener

func (api *API) DeleteTrapListener(id int32)

DeleteTrapListener assumes that the trap listener is was deleted from database and stops and remove the listener.

func (*API) GetServicesStatus

func (api *API) GetServicesStatus() []service.ServiceStatus

GetServices status returns the current status of the services saved locally.

func (*API) Run

func (api *API) Run()

func (*API) SetUserActivity

func (api *API) SetUserActivity(userId int32)

func (*API) UpdateTrapListener

func (api *API) UpdateTrapListener(tl models.TrapListener)

UpdateTrapListener assumes that the trap listener is was updated on database and updates the listener.

type APIResponse

type APIResponse struct {
	Data    any    `json:"data"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

Jump to

Keyboard shortcuts

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