handlers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(
	cfg *fanucService.Config,
	connHandler *ConnectionHandler,
	pollHandler *PollingHandler,
	progHandler *ProgramHandler,
) *gin.Engine

func RespondError

func RespondError(c *gin.Context, code int, message string, data ...interface{})

func RespondMessage

func RespondMessage(c *gin.Context, message string)

func RespondSuccess

func RespondSuccess(c *gin.Context, data interface{})

Types

type ConnectionHandler

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

func NewConnectionHandler

func NewConnectionHandler(usecase interfaces.ConnectionUsecase) *ConnectionHandler

func (*ConnectionHandler) Create

func (h *ConnectionHandler) Create(c *gin.Context)

Create @Summary Create a new connection @Description Connects to a Fanuc machine @Tags Connection @Accept json @Produce json @Param input body models.ConnectionRequest true "Connection Data" @Security ApiKeyAuth @Success 200 {object} models.APIResponse @Failure 400 {object} models.APIResponse @Failure 500 {object} models.APIResponse @Router /api/v1/connect [post]

func (*ConnectionHandler) Delete

func (h *ConnectionHandler) Delete(c *gin.Context)

Delete @Summary Delete connection @Tags Connection @Param id query string true "Machine ID" @Produce json @Security ApiKeyAuth @Success 200 {object} models.APIResponse @Router /api/v1/connect [delete]

func (*ConnectionHandler) Get

func (h *ConnectionHandler) Get(c *gin.Context)

Get @Summary Get connections or Check specific connection @Description If 'id' is provided, checks health of specific connection. If not, lists all connections. @Tags Connection @Produce json @Param id query string false "Machine ID (optional)" @Security ApiKeyAuth @Success 200 {object} models.APIResponse @Router /api/v1/connect [get]

type PollingHandler

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

func NewPollingHandler

func NewPollingHandler(usecase interfaces.PollingUsecase) *PollingHandler

func (*PollingHandler) Start

func (h *PollingHandler) Start(c *gin.Context)

Start @Summary Start polling for a machine @Description Starts periodic data collection for a specific machine session @Tags Polling @Accept json @Produce json @Param input body models.StartPollingRequest true "Polling Config" @Security ApiKeyAuth @Success 200 {object} models.APIResponse @Failure 400 {object} models.APIResponse @Failure 500 {object} models.APIResponse @Router /api/v1/polling/start [post]

func (*PollingHandler) Stop

func (h *PollingHandler) Stop(c *gin.Context)

Stop @Summary Stop polling for a machine @Description Stops periodic data collection @Tags Polling @Accept json @Produce json @Param input body models.StopPollingRequest true "Polling Config" @Security ApiKeyAuth @Success 200 {object} models.APIResponse @Failure 400 {object} models.APIResponse @Failure 500 {object} models.APIResponse @Router /api/v1/polling/stop [post]

type ProgramHandler

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

func NewProgramHandler

func NewProgramHandler(usecase interfaces.ProgramUsecase) *ProgramHandler

func (*ProgramHandler) Get

func (h *ProgramHandler) Get(c *gin.Context)

Get @Summary Get full control program @Description Returns the raw text of the current executing program (G-Code) @Tags Program @Produce plain @Param id query string true "Machine ID" @Security ApiKeyAuth @Success 200 {string} string "Program content" @Failure 400 {object} models.APIResponse @Failure 500 {object} models.APIResponse @Router /api/v1/program [get]

Jump to

Keyboard shortcuts

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