Documentation ¶
Index ¶
- type Handler
- func (h *Handler) ListLogicServices(c *gin.Context)
- func (h *Handler) ListLogics(c *gin.Context)
- func (h *Handler) ListNodes(c *gin.Context)
- func (h *Handler) ListSensors(c *gin.Context)
- func (h *Handler) ListSinks(c *gin.Context)
- func (h *Handler) ListTopics(c *gin.Context)
- func (h *Handler) RegistLogic(c *gin.Context)
- func (h *Handler) RegistLogicService(c *gin.Context)
- func (h *Handler) RegistNode(c *gin.Context)
- func (h *Handler) RegistSensor(c *gin.Context)
- func (h *Handler) RegistSink(c *gin.Context)
- func (h *Handler) RegistTopic(c *gin.Context)
- func (h *Handler) UnregistLogic(c *gin.Context)
- func (h *Handler) UnregistLogicService(c *gin.Context)
- func (h *Handler) UnregistNode(c *gin.Context)
- func (h *Handler) UnregistSensor(c *gin.Context)
- func (h *Handler) UnregistSink(c *gin.Context)
- func (h *Handler) UnregistTopic(c *gin.Context)
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 NewHandler ¶
func NewHandler(ru usecase.RegistUsecase, eu usecase.EventUsecase) *Handler
func (*Handler) ListLogicServices ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
TODO : if l.Addr is dubplicated then remove old one
func (*Handler) RegistNode ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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]