Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
AccessToken receive a id from request url and return the access token of the specific id
AccessToken godoc @Summary Node AccessToken @Description Node AccessToken according to nid @ID Nodes.AccessToken @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} accessTokenResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid}/token [get]
func Create ¶
Create receive a id and a node object from request and update the specific record in DB
Create godoc @Summary Create Node @Description Create node from post json object @ID Nodes.Create @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param node body models.Node true "Node Object" @Param Authorization header string true "Access Token" @Success 200 {object} createResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes [post]
func Destroy ¶
Destroy receive a id from request and delete in from DB
Destroy godoc @Summary Destroy Node @Description Destroy Node according to nid @ID Nodes.Destroy @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} destroyResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid} [delete]
func GenerateToken ¶
GenerateToken receive a id from request url and return the access token of the specific id
GenerateToken godoc @Summary Generate Node AccessToken @Description Generate Node AccessToken according to nid @ID Nodes.GenerateToken @Security ApiKeyAuth @Tags Nodes @Accept plain @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} accessTokenResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid}/token [post]
func Index ¶
Index handle GET /nodes which simply list out all nodes accept gid param as filter
Index godoc @Summary All Nodes @Description Simply list out all Nodes @ID Nodes.Index @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param Authorization header string true "Access Token" @Success 200 {object} indexResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes [get]
func Services ¶
Services receive a id from request url and return all the services a node has
Services godoc @Summary Node Services @Description Show services of a node @ID Nodes.Services @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} servicesResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid}/services [get]
func Show ¶
Show receive a id from request url and return the node of the specific id
Show godoc @Summary Show Node @Description Show Node according to nid @ID Nodes.Show @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} showResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid} [get]
func Traffic ¶
Traffic receive traffic info and update it
Traffic godoc @Summary Update user traffic @Description Update user traffic @ID nodes.Traffic @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param traffic body trafficRequest true "Traffic Info Object" @Param nid path uint true "Node ID" @Param username path string true "Username" @Param Authorization header string false "Node Token" @Success 200 {object} trafficResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid}/users/{username}/traffic [patch]
func Update ¶
Update receive a id and a node object from request and update the specific record in DB
Update godoc @Summary Update Node @Description Update a Node @ID Nodes.Update @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param node body models.Node true "Node Object" @Param Authorization header string true "Access Token" @Success 200 {object} updateResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid} [patch]
func Users ¶
Users receive a id from request url and return all the Users a node has
Users godoc @Summary Node Users @Description Show Users of a node @ID Nodes.Users @Security ApiKeyAuth @Tags Nodes @Accept json @Produce json @Param nid path uint true "Node ID" @Param Authorization header string true "Access Token" @Success 200 {object} usersResponse @Failure 403 {object} handler.ErrorResponse @Failure 500 {object} handler.ErrorResponse @Router /nodes/{nid}/users [get]
Types ¶
This section is empty.