handler

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNearestNode

func GetNearestNode(c *gin.Context)

func GetNodeById

func GetNodeById(c *gin.Context)

func GetNodeSearchQuery

func GetNodeSearchQuery(c *gin.Context)

func GetNodeSearchSource

func GetNodeSearchSource(c *gin.Context)

func GetNodeSearchTarget

func GetNodeSearchTarget(c *gin.Context)

func GetPOIs

func GetPOIs(c *gin.Context)

func GetRouteAsGeometry

func GetRouteAsGeometry(c *gin.Context)

func GetRouteAsList

func GetRouteAsList(c *gin.Context)

func GetTSP

func GetTSP(c *gin.Context)

func HandleGetFleetRequest

func HandleGetFleetRequest(c *gin.Context)

func HandlePostFleetRequest

func HandlePostFleetRequest(c *gin.Context)

func HandlePostOrderRequest

func HandlePostOrderRequest(c *gin.Context)

func HandlePostStartOrderRequest

func HandlePostStartOrderRequest(c *gin.Context)

func HeadersMiddleware

func HeadersMiddleware() gin.HandlerFunc

Types

type ClientChan

type ClientChan chan string

type EventStreamHandler

type EventStreamHandler struct {
	// Events are pushed to this channel by the main events-gathering routine
	PositionEventMessage    chan routing.PostionEvent
	RouteEventMessage       chan routing.RouteEvent
	TruckActionEventMessage chan routing.TruckActionEvent

	// New client connections
	NewClients chan chan string

	// Closed client connections
	ClosedClients chan chan string

	// Total client connections
	TotalClients map[chan string]bool
}

func NewEventStreamHandler

func NewEventStreamHandler() (event *EventStreamHandler)

Initialize event and Start procnteessing requests

func (*EventStreamHandler) GetPositionStream

func (stream *EventStreamHandler) GetPositionStream(c *gin.Context)

func (*EventStreamHandler) ServeHTTP

func (stream *EventStreamHandler) ServeHTTP() gin.HandlerFunc

type HealthHandler

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

Tests is a http.Handler

func NewHealthHandler

func NewHealthHandler(ctx context.Context, l *log.Logger, mongoDatabase *mongo.Database, redisClient *redis.Client) *HealthHandler

NewHealthHandler creates a products handler with the given logger

func (*HealthHandler) HandleGetRequest

func (handler *HealthHandler) HandleGetRequest(c *gin.Context)

swagger:operation GET /tests tests listTests Returns list of tests --- produces: - application/json responses:

'200':
    description: Successful operation

getHealthHandler returns the products from the data store

type NodeType

type NodeType int
const (
	SOURCE NodeType = iota + 1
	TARGET
	UNKNOWN
)

type StartOrderRequest

type StartOrderRequest struct {
	Order string `form:"order" json:"order" bson:"order" binding:"required"`
	Truck string `form:"truck" json:"truck" bson:"truck" binding:"required"`
	Start int    `form:"start" json:"start" bson:"start" binding:"required"`
}

type Status

type Status struct {
	Status    string `json:"status"`
	Message   string `json:"message"`
	Substatus []SubStatus
}

type SubStatus

type SubStatus struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

type TestHandler

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

Tests is a http.Handler

func NewTestHandler

func NewTestHandler(ctx context.Context, l *log.Logger, mongoDatabase *mongo.Database, redisClient *redis.Client) *TestHandler

NewTestHandler creates a products handler with the given logger

func (*TestHandler) HandleDeleteRequest

func (handler *TestHandler) HandleDeleteRequest(c *gin.Context)

swagger:operation DELETE /tests/{id} tests deleteRecipe Delete an existing test --- produces: - application/json parameters:

  • name: id in: path description: ID of the test required: true type: string

responses:

'200':
    description: Successful operation
'404':
    description: Invalid test ID

func (*TestHandler) HandleGetAllTestsRequest

func (handler *TestHandler) HandleGetAllTestsRequest(c *gin.Context)

swagger:operation GET /tests tests listTests Returns list of tests --- produces: - application/json responses:

'200':
    description: Successful operation

getTestHandler returns the products from the data store

func (*TestHandler) HandleGetTestByIdRequest

func (handler *TestHandler) HandleGetTestByIdRequest(c *gin.Context)

swagger:operation GET /tests/{id} tests Get one test --- produces: - application/json parameters:

  • name: id in: path description: test ID required: true type: string

responses:

'200':
    description: Successful operation

func (*TestHandler) HandlePostRequest

func (handler *TestHandler) HandlePostRequest(c *gin.Context)

swagger:operation POST /tests tests newRecipe Create a new test --- produces: - application/json responses:

'200':
    description: Successful operation
'400':
    description: Invalid input

func (*TestHandler) HandlePutRequest

func (handler *TestHandler) HandlePutRequest(c *gin.Context)

swagger:operation PUT /tests/{id} tests updateRecipe Update an existing test --- parameters:

  • name: id in: path description: ID of the test required: true type: string

produces: - application/json responses:

'200':
    description: Successful operation
'400':
    description: Invalid input
'404':
    description: Invalid test ID

Jump to

Keyboard shortcuts

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