@@ -15,12 +15,12 @@ import (
1515
1616const ErrorPeerAliasIsNotUniq = "peer name is not unique"
1717
18- // @Tags Peers
19- // @Summary Get known peers info
20- // @Accept json
21- // @Produce json
22- // @Success 200 {array} entity.KnownPeersResponse
23- // @Router /peers/get_known [GET]
18+ // @Tags Peers
19+ // @Summary Get known peers info
20+ // @Accept json
21+ // @Produce json
22+ // @Success 200 {array} entity.KnownPeersResponse
23+ // @Router /peers/get_known [GET]
2424func (h * Handler ) GetKnownPeers (c echo.Context ) (err error ) {
2525 result := h .getKnownPeers ()
2626 return c .JSON (http .StatusOK , result )
@@ -71,15 +71,15 @@ func (h *Handler) getKnownPeers() []entity.KnownPeersResponse {
7171 return result
7272}
7373
74- // @Tags Peers
75- // @Summary Get known peer settings
76- // @Accept json
77- // @Produce json
78- // @Param body body entity.PeerIDRequest true "Params"
79- // @Success 200 {object} config.KnownPeer
80- // @Failure 400 {object} api.Error
81- // @Failure 404 {object} api.Error
82- // @Router /peers/get_known_peer_settings [POST]
74+ // @Tags Peers
75+ // @Summary Get known peer settings
76+ // @Accept json
77+ // @Produce json
78+ // @Param body body entity.PeerIDRequest true "Params"
79+ // @Success 200 {object} config.KnownPeer
80+ // @Failure 400 {object} api.Error
81+ // @Failure 404 {object} api.Error
82+ // @Router /peers/get_known_peer_settings [POST]
8383func (h * Handler ) GetKnownPeerSettings (c echo.Context ) (err error ) {
8484 req := entity.PeerIDRequest {}
8585 err = c .Bind (& req )
@@ -97,15 +97,15 @@ func (h *Handler) GetKnownPeerSettings(c echo.Context) (err error) {
9797 return c .JSON (http .StatusOK , knownPeer )
9898}
9999
100- // @Tags Peers
101- // @Summary Update peer settings
102- // @Accept json
103- // @Produce json
104- // @Param body body entity.UpdatePeerSettingsRequest true "Params"
105- // @Success 200 "OK"
106- // @Failure 400 {object} api.Error
107- // @Failure 404 {object} api.Error
108- // @Router /peers/update_settings [POST]
100+ // @Tags Peers
101+ // @Summary Update peer settings
102+ // @Accept json
103+ // @Produce json
104+ // @Param body body entity.UpdatePeerSettingsRequest true "Params"
105+ // @Success 200 "OK"
106+ // @Failure 400 {object} api.Error
107+ // @Failure 404 {object} api.Error
108+ // @Router /peers/update_settings [POST]
109109func (h * Handler ) UpdatePeerSettings (c echo.Context ) (err error ) {
110110 req := entity.UpdatePeerSettingsRequest {}
111111 err = c .Bind (& req )
@@ -151,15 +151,15 @@ func (h *Handler) UpdatePeerSettings(c echo.Context) (err error) {
151151 return c .NoContent (http .StatusOK )
152152}
153153
154- // @Tags Peers
155- // @Summary Invite new peer
156- // @Accept json
157- // @Produce json
158- // @Param body body entity.FriendRequest true "Params"
159- // @Success 200 "OK"
160- // @Failure 400 {object} api.Error
161- // @Failure 500 {object} api.Error
162- // @Router /peers/invite_peer [POST]
154+ // @Tags Peers
155+ // @Summary Invite new peer
156+ // @Accept json
157+ // @Produce json
158+ // @Param body body entity.FriendRequest true "Params"
159+ // @Success 200 "OK"
160+ // @Failure 400 {object} api.Error
161+ // @Failure 500 {object} api.Error
162+ // @Router /peers/invite_peer [POST]
163163func (h * Handler ) SendFriendRequest (c echo.Context ) (err error ) {
164164 req := entity.FriendRequest {}
165165 err = c .Bind (& req )
@@ -188,15 +188,15 @@ func (h *Handler) SendFriendRequest(c echo.Context) (err error) {
188188 return c .NoContent (http .StatusOK )
189189}
190190
191- // @Tags Peers
192- // @Summary Accept new peer's invitation
193- // @Accept json
194- // @Produce json
195- // @Param body body entity.FriendRequestReply true "Params"
196- // @Success 200 "OK"
197- // @Failure 400 {object} api.Error
198- // @Failure 500 {object} api.Error
199- // @Router /peers/accept_peer [POST]
191+ // @Tags Peers
192+ // @Summary Accept new peer's invitation
193+ // @Accept json
194+ // @Produce json
195+ // @Param body body entity.FriendRequestReply true "Params"
196+ // @Success 200 "OK"
197+ // @Failure 400 {object} api.Error
198+ // @Failure 500 {object} api.Error
199+ // @Router /peers/accept_peer [POST]
200200func (h * Handler ) AcceptFriend (c echo.Context ) (err error ) {
201201 req := entity.FriendRequestReply {}
202202 err = c .Bind (& req )
@@ -236,12 +236,12 @@ func (h *Handler) AcceptFriend(c echo.Context) (err error) {
236236 return c .NoContent (http .StatusOK )
237237}
238238
239- // @Tags Peers
240- // @Summary Get ingoing auth requests
241- // @Accept json
242- // @Produce json
243- // @Success 200 {array} entity.AuthRequest
244- // @Router /peers/auth_requests [GET]
239+ // @Tags Peers
240+ // @Summary Get ingoing auth requests
241+ // @Accept json
242+ // @Produce json
243+ // @Success 200 {array} entity.AuthRequest
244+ // @Router /peers/auth_requests [GET]
245245func (h * Handler ) GetAuthRequests (c echo.Context ) (err error ) {
246246 authRequestsMap := h .authStatus .GetIngoingAuthRequests ()
247247 authRequests := make ([]entity.AuthRequest , 0 , len (authRequestsMap ))
@@ -271,15 +271,15 @@ func (h *Handler) GetAuthRequests(c echo.Context) (err error) {
271271 return c .JSON (http .StatusOK , authRequests )
272272}
273273
274- // @Tags Peers
275- // @Summary Remove known peer
276- // @Accept json
277- // @Produce json
278- // @Param body body entity.PeerIDRequest true "Params"
279- // @Success 200 "OK"
280- // @Failure 400 {object} api.Error
281- // @Failure 404 {object} api.Error
282- // @Router /peers/remove [POST]
274+ // @Tags Peers
275+ // @Summary Remove known peer
276+ // @Accept json
277+ // @Produce json
278+ // @Param body body entity.PeerIDRequest true "Params"
279+ // @Success 200 "OK"
280+ // @Failure 400 {object} api.Error
281+ // @Failure 404 {object} api.Error
282+ // @Router /peers/remove [POST]
283283func (h * Handler ) RemovePeer (c echo.Context ) (err error ) {
284284 req := entity.PeerIDRequest {}
285285 err = c .Bind (& req )
@@ -306,12 +306,12 @@ func (h *Handler) RemovePeer(c echo.Context) (err error) {
306306 return c .NoContent (http .StatusOK )
307307}
308308
309- // @Tags Peers
310- // @Summary Get blocked peers info
311- // @Accept json
312- // @Produce json
313- // @Success 200 {array} config.BlockedPeer
314- // @Router /peers/get_blocked [GET]
309+ // @Tags Peers
310+ // @Summary Get blocked peers info
311+ // @Accept json
312+ // @Produce json
313+ // @Success 200 {array} config.BlockedPeer
314+ // @Router /peers/get_blocked [GET]
315315func (h * Handler ) GetBlockedPeers (c echo.Context ) (err error ) {
316316 h .conf .RLock ()
317317 result := make ([]config.BlockedPeer , 0 , len (h .conf .BlockedPeers ))
0 commit comments