handler

package
v0.0.0-...-35ec728 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func (*Handler) ListLogicServices

func (h *Handler) ListLogicServices(c *gin.Context)

ListLogicServices ... @Summary List LogicServices info @Description get LogicServices list @Tags LogicService @Produce json @Success 200 {array} model.LogicService "return all logics info." @Router /regist/logic-service [get]

func (*Handler) ListLogics

func (h *Handler) ListLogics(c *gin.Context)

ListLogics ... @Summary List logics info @Description get logics list @Tags logic @Produce json @Success 200 {array} model.Logic "return all logics info." @Router /regist/logic [get]

func (*Handler) ListNodes

func (h *Handler) ListNodes(c *gin.Context)

ListNodes ... @Summary List sensor node @Description get nodes list @Tags node @Param page query int false "page num" @Param size query int false "page size(row)" @Param sink query int false "sink filter" @Param left query float32 false "location(longitude) filter" @Param right query float32 false "location(longitude) filter" @Param up query float32 false "location(Latitude) filter" @Param down query float32 false "location(Latitude) filter" @Produce json @Success 200 {array} model.Node "default, return all nodes. if location query is exist, return location filter result(square)." @Success 201 {object} adapter.NodePage "if page query is exist, return pagenation result. pages only valid when page is 1." @Router /regist/node [get]

func (*Handler) ListSensors

func (h *Handler) ListSensors(c *gin.Context)

ListSensors ... @Summary List sensor info @Description get sensors list @Tags sensor @Param page query int false "page num" @Param size query int false "page size(row)" @Produce json @Success 200 {array} model.Sensor "default, return all sensors." @Success 201 {object} adapter.SensorPage "if page query is exist, return pagenation result. pages only valid when page is 1." @Router /regist/sensor [get]

func (*Handler) ListSinks

func (h *Handler) ListSinks(c *gin.Context)

ListSinks ... @Summary List sink node(raspi info) @Description get sinks list @Tags sink @Param page query int false "page num" @Param size query int false "page size(row)" @Produce json @Success 200 {array} model.Sink "default, return all sinks." @Success 201 {object} adapter.SinkPage "if page query is exist, return pagenation result. pages only valid when page is 1." @Router /regist/sink [get]

func (*Handler) ListTopics

func (h *Handler) ListTopics(c *gin.Context)

ListTopics ... @Summary List topics info @Description get topics list @Tags topic @Produce json @Success 200 {array} model.Topic "return all topics info." @Router /regist/topic [get]

func (*Handler) RegistLogic

func (h *Handler) RegistLogic(c *gin.Context)

RegistLogic ... @Summary Add logic info @Description Add logic info @Tags logic @Param logic body adapter.Logic true "logic_name, elems" @Accept json @Produce json @Success 200 {object} adapter.Logic "include sensor info" @Router /regist/logic [post]

func (*Handler) RegistLogicService

func (h *Handler) RegistLogicService(c *gin.Context)

TODO : if l.Addr is dubplicated then remove old one

func (*Handler) RegistNode

func (h *Handler) RegistNode(c *gin.Context)

RegistNode ... @Summary Add sensor node @Description Add sensor node @Tags node @Param node body model.Node true "name, lat, lng, sink_id" @Accept json @Produce json @Success 200 {object} model.Node "include sink, sink.topic, sensors, sensors.logics info" @Router /regist/node [post]

func (*Handler) RegistSensor

func (h *Handler) RegistSensor(c *gin.Context)

RegistSensor ... @Summary Add sensor info @Description Add sensor info @Tags sensor @Param sensor body model.Sensor true "name, sensorValues(only value name)" @Accept json @Produce json @Success 200 {object} model.Node "include sensorValues info" @Router /regist/sensor [post]

func (*Handler) RegistSink

func (h *Handler) RegistSink(c *gin.Context)

RegistSink ... @Summary Add sink node(raspi info) @Description Add sink node @Tags sink @Param sink body model.Sink true "name, address(only ip address, don't include port)" @Accept json @Produce json @Success 200 {object} model.Sink "include topic info" @Router /regist/sink [post]

func (*Handler) RegistTopic

func (h *Handler) RegistTopic(c *gin.Context)

RegistTopic ... @Summary Add topic info @Description Add topic info @Tags topic @Param logic body model.Logic true "name, partitions, replications" @Accept json @Produce json @Success 200 {object} model.Topic @Router /regist/topic [post]

func (*Handler) UnregistLogic

func (h *Handler) UnregistLogic(c *gin.Context)

UnregistLogic ... @Summary Delete logic @Description Delete logic @Tags logic @Param id path int true "logic's id" @Accept json @Produce json @Success 200 {object} model.Logic "include sensor info" @Router /regist/logic [delete]

func (*Handler) UnregistLogicService

func (h *Handler) UnregistLogicService(c *gin.Context)

UnregistLogicService ... @Summary Delete LogicService @Description Delete LogicService @Tags logicService @Param id path int true "logicSerivce's id" @Accept json @Produce json @Success 200 {object} model.Logic "include topic info" @Router /regist/logic-service [delete]

func (*Handler) UnregistNode

func (h *Handler) UnregistNode(c *gin.Context)

UnregistNode ... @Summary Delete sensor node @Description Delete sensor node @Tags node @Param id path int true "node's id" @Accept json @Produce json @Success 200 {object} model.Node "include sink, sink.topic info" @Router /regist/node [delete]

func (*Handler) UnregistSensor

func (h *Handler) UnregistSensor(c *gin.Context)

UnregistSensor ... @Summary Delete sensor @Description Delete sensor @Tags sensor @Param id path int true "sensor's id" @Accept json @Produce json @Success 200 {object} model.Sensor "include logics info" @Router /regist/sensor [delete]

func (*Handler) UnregistSink

func (h *Handler) UnregistSink(c *gin.Context)

UnregistSink ... @Summary Delete sink node(raspi info) @Description Delete sink node @Tags sink @Param id path int true "sink's id" @Accept json @Produce json @Success 200 {object} model.Sink "include topic, nodes info" @Router /regist/sink [delete]

func (*Handler) UnregistTopic

func (h *Handler) UnregistTopic(c *gin.Context)

UnregistTopic ... @Summary Delete topic(kafka topic for logicservices) @Description Delete topic(kafka topic for logicservices) @Tags topic @Param id path int true "topic's id" @Accept json @Produce json @Success 200 {object} model.Topic "include logicService info" @Router /regist/topic [delete]

Jump to

Keyboard shortcuts

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