Documentation ¶
Index ¶
- type APIHandler
- type ClubsHandler
- func (h *ClubsHandler) BasePrefix() string
- func (h *ClubsHandler) DeleteClub(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) DeleteClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetAllClubs(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClearancePost(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClub(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClubMembers(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClubsByName(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) GetClubsByType(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) PostClub(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) PostClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) Routes() chi.Router
- func (h *ClubsHandler) UpdateClub(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *ClubsHandler) UpdateClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
- type DocumentsHandler
- func (h *DocumentsHandler) BasePrefix() string
- func (h *DocumentsHandler) DeleteCategory(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) DeleteDocument(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetAllCategories(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetAllDocuments(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetCategory(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetDocument(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetDocumentsByCategory(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) GetDocumentsByClubID(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) PostCategory(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) PostDocument(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) Routes() chi.Router
- func (h *DocumentsHandler) UpdateCategory(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *DocumentsHandler) UpdateDocument(w http.ResponseWriter, req *http.Request) handler.Response
- type EventsHandler
- func (h *EventsHandler) BasePrefix() string
- func (h *EventsHandler) DeleteEvent(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *EventsHandler) GetAllEvents(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *EventsHandler) GetEvent(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *EventsHandler) GetEventsByRange(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *EventsHandler) PostEvent(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *EventsHandler) Routes() chi.Router
- func (h *EventsHandler) UpdateEvent(w http.ResponseWriter, req *http.Request) handler.Response
- type FeedHandler
- func (h *FeedHandler) BasePrefix() string
- func (h *FeedHandler) DeleteEncounter(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) DeleteFeed(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) GetAllFeed(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) GetFeed(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) GetFeedByTitle(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) GetFeedEncounters(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) PostEncounter(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) PostFeed(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) Routes() chi.Router
- func (h *FeedHandler) UpdateEncounter(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *FeedHandler) UpdateFeed(w http.ResponseWriter, req *http.Request) handler.Response
- type GuardHandler
- func (h *GuardHandler) BasePrefix() string
- func (h *GuardHandler) LoginUser(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *GuardHandler) LogoutUser(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *GuardHandler) RegisterUser(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *GuardHandler) Routes() chi.Router
- type MediaHandler
- func (h *MediaHandler) BasePrefix() string
- func (h *MediaHandler) DeleteMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) GetMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) GetMediaDefaultByID(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) PostMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) PostMediaPrivate(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) PostMediaPublic(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MediaHandler) Routes() chi.Router
- func (h *MediaHandler) UpdateMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
- type MembersHandler
- func (h *MembersHandler) BasePrefix() string
- func (h *MembersHandler) DeleteMember(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MembersHandler) GetAllMembers(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MembersHandler) GetMember(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MembersHandler) GetMembersByName(w http.ResponseWriter, req *http.Request) handler.Response
- func (h *MembersHandler) Routes() chi.Router
- func (h *MembersHandler) UpdateMember(w http.ResponseWriter, req *http.Request) handler.Response
- type SwagHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
func NewAPIHandler ¶
func NewAPIHandler(r handler.Renderer, api app.API) *APIHandler
func (*APIHandler) BasePrefix ¶
func (h *APIHandler) BasePrefix() string
func (*APIHandler) Routes ¶
func (h *APIHandler) Routes() chi.Router
type ClubsHandler ¶
type ClubsHandler struct {
// contains filtered or unexported fields
}
func NewClubsHandler ¶
func NewClubsHandler(r handler.Renderer, clubs app.ClubService, logger *log.Logger, guard *app.GuardService) *ClubsHandler
func (*ClubsHandler) BasePrefix ¶
func (h *ClubsHandler) BasePrefix() string
func (*ClubsHandler) DeleteClub ¶
func (h *ClubsHandler) DeleteClub(w http.ResponseWriter, req *http.Request) handler.Response
DeleteClub
@Summary Удаляет клуб из базу данных @Description Удаляет клуб в базу данных, а также все объеуты ассоциируемые с ним, требуется аутентификация @Tags auth.club @Produce json @Param club_id path int true "club id" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /clubs [delete] @Security Authorized
func (*ClubsHandler) DeleteClubMedia ¶
func (h *ClubsHandler) DeleteClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
DeleteClubPhoto
@Summary Удаляет фотографию из фотографий клуба @Description Удаляет фотографию из фотографий клуба @Tags auth.club @Produce json @Param club_id path int true "club id" @Param request body requests.DeleteClubPhoto true "post club photo data" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /clubs/media/{club_id} [delete] @Security Authorized
func (*ClubsHandler) GetAllClubs ¶
func (h *ClubsHandler) GetAllClubs(w http.ResponseWriter, req *http.Request) handler.Response
GetAllClubs
@Summary Возвращает все клубы из БД @Description Возвращает все клубы для страницы с поиском клубов @Tags public.club @Produce json @Success 200 {object} responses.GetAllClubs @Failure 404 @Failure 500 @Router /clubs [get] @Security Public
func (*ClubsHandler) GetClearancePost ¶
func (h *ClubsHandler) GetClearancePost(w http.ResponseWriter, req *http.Request) handler.Response
func (*ClubsHandler) GetClub ¶
func (h *ClubsHandler) GetClub(w http.ResponseWriter, req *http.Request) handler.Response
GetClub
@Summary Возвращает клуб по ID @Description Возвращает информацию о клубе для страницы клуба @Tags public.club @Produce json @Param club_id path int true "club id" @Success 200 {object} responses.GetClub @Failure 400 @Failure 404 @Failure 500 @Router /clubs/{club_id} [get] @Security Public
func (*ClubsHandler) GetClubMedia ¶
func (h *ClubsHandler) GetClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
GetClubMedia
@Summary Возвращает фотографии клуба @Description Возвращает фотографии клуба по его ID @Tags public.club @Produce json @Param club_id path int true "club id" @Success 200 {object} responses.GetClubMedia @Failure 400 @Failure 404 @Failure 500 @Router /clubs/media/{club_id} [get] @Security Public
func (*ClubsHandler) GetClubMembers ¶
func (h *ClubsHandler) GetClubMembers(w http.ResponseWriter, req *http.Request) handler.Response
GetClubMembers
@Summary Возвращает руководителя клуба и руководителей подклубов @Description Возвращает руководителя клуба и руководителей подклубов(1-го уровня) по ID клуба @Tags public.club @Produce json @Param club_id path int true "club id" @Success 200 {object} responses.GetClubMembers @Failure 400 @Failure 404 @Failure 500 @Router /clubs/members/{club_id} [get] @Security Public
func (*ClubsHandler) GetClubsByName ¶
func (h *ClubsHandler) GetClubsByName(w http.ResponseWriter, req *http.Request) handler.Response
GetClubsByName
@Summary Возвращает все клубы по имени @Description Возвращает все клубы, у которых введенная строка является подстрокой в имени @Tags public.club @Produce json @Param club_name path string true "club name" @Success 200 {object} responses.GetClubsByName @Failure 400 @Failure 404 @Failure 500 @Router /clubs/search/{club_name} [get] @Security Public
func (*ClubsHandler) GetClubsByType ¶
func (h *ClubsHandler) GetClubsByType(w http.ResponseWriter, req *http.Request) handler.Response
GetClubsByType
@Summary Возвращает все клубы по типу @Description Возвращает все клубы, у которых введенная строка является подстрокой в типе @Tags public.club @Produce json @Param club_type path string true "club type" @Success 200 {object} responses.GetClubsByType @Failure 400 @Failure 404 @Failure 500 @Router /clubs/type/{club_type} [get] @Security Public
func (*ClubsHandler) PostClub ¶
func (h *ClubsHandler) PostClub(w http.ResponseWriter, req *http.Request) handler.Response
PostClub
@Summary Добавляет клуб в базу данных @Description Добавляет клуб в базу данных, требуется аутентификация @Tags auth.club @Produce json @Param request body requests.PostClub true "post club data" @Success 200 @Failure 400 @Failure 401 @Failure 409 @Failure 500 @Router /clubs [post] @Security Authorized
func (*ClubsHandler) PostClubMedia ¶
func (h *ClubsHandler) PostClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
PostClubPhoto
@Summary Добавляет в клуб фотографии клуба в базу данных @Description Добавляет в клуб фотографии клуба в базу данных @Tags auth.club @Produce json @Param club_id path int true "club id" @Param request body requests.PostClubPhoto true "post club photo data" @Success 200 @Failure 400 @Failure 401 @Failure 409 @Failure 500 @Router /clubs/media/{club_id} [post] @Security Authorized
func (*ClubsHandler) Routes ¶
func (h *ClubsHandler) Routes() chi.Router
func (*ClubsHandler) UpdateClub ¶
func (h *ClubsHandler) UpdateClub(w http.ResponseWriter, req *http.Request) handler.Response
UpdateClub
@Summary Обновляет данные клуба в базе данных @Description Обновляет данные клуба в базе данных, требуется аутентификация @Tags auth.club @Produce json @Param club_id path int true "club id" @Param request body requests.PostClub true "update club data" @Success 200 @Failure 400 @Failure 401 @Failure 409 @Failure 404 @Failure 500 @Router /clubs [put] @Security Authorized
func (*ClubsHandler) UpdateClubMedia ¶
func (h *ClubsHandler) UpdateClubMedia(w http.ResponseWriter, req *http.Request) handler.Response
UpdateClubPhoto
@Summary Обновляет все фотографии клуба @Description Обновляет все фотографии клуба @Tags auth.club @Produce json @Param club_id path int true "club id" @Param request body requests.UpdateClubPhoto true "post club photo data" @Success 200 @Failure 400 @Failure 401 @Failure 409 @Failure 500 @Router /clubs/media/{club_id} [put] @Security Authorized
type DocumentsHandler ¶
type DocumentsHandler struct {
// contains filtered or unexported fields
}
func NewDocumentsHandler ¶
func NewDocumentsHandler(r handler.Renderer, documents app.DocumentsService, categories app.DocumentCategoriesService, logger *log.Logger, guard *app.GuardService) *DocumentsHandler
func (*DocumentsHandler) BasePrefix ¶
func (h *DocumentsHandler) BasePrefix() string
func (*DocumentsHandler) DeleteCategory ¶
func (h *DocumentsHandler) DeleteCategory(w http.ResponseWriter, req *http.Request) handler.Response
DeleteCategory deletes a document category by ID
@Summary Delete a document category by ID @Description Delete a specific document category using its ID @Tags auth.documents @Param id path string true "DocumentCategory ID" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /documents/categories/{id} [delete] @Security Authorised
func (*DocumentsHandler) DeleteDocument ¶
func (h *DocumentsHandler) DeleteDocument(w http.ResponseWriter, req *http.Request) handler.Response
@Router /documents/{id} [delete] @Security Authorised
func (*DocumentsHandler) GetAllCategories ¶
func (h *DocumentsHandler) GetAllCategories(w http.ResponseWriter, req *http.Request) handler.Response
GetAllCategories retrieves all available categories of documents
@Summary Retrieve all document categories @Description Get a list of all categories to which a document may be attributed to @Tags public.documents @Produce json @Success 200 {object} responses.GetAllDocumentCategories @Failure 404 @Failure 500 @Router /documents/categories/ [get] @Security public
func (*DocumentsHandler) GetAllDocuments ¶
func (h *DocumentsHandler) GetAllDocuments(w http.ResponseWriter, req *http.Request) handler.Response
GetAllDocuments retrieves all documents items
@Summary Retrieve all documents items @Description Get a list of all documents items @Tags public.documents @Produce json @Success 200 {object} responses.GetAllDocuments @Failure 404 @Failure 500 @Router /documents/ [get] @Security public
func (*DocumentsHandler) GetCategory ¶
func (h *DocumentsHandler) GetCategory(w http.ResponseWriter, req *http.Request) handler.Response
@Router /documents/categories/{id} [get] @Security public
func (*DocumentsHandler) GetDocument ¶
func (h *DocumentsHandler) GetDocument(w http.ResponseWriter, req *http.Request) handler.Response
GetDocument retrieves a document item by its ID
@Summary Retrieve document item by ID @Description Get a specific document item using its ID @Tags public.documents @Produce json @Param id path string true "id" @Success 200 {object} responses.GetDocument @Failure 400 @Failure 404 @Failure 500 @Router /documents/{id} [get] @Security public
func (*DocumentsHandler) GetDocumentsByCategory ¶
func (h *DocumentsHandler) GetDocumentsByCategory(w http.ResponseWriter, req *http.Request) handler.Response
GetDocumentsByCategory retrieves a slice of documents by its category
@Summary Retrieve documents by category @Description Get documents corresponding to a certain category @Tags public.documents @Produce json @Param category_id path string true "category_id" @Success 200 {object} responses.GetDocumentsByCategory @Failure 400 @Failure 404 @Failure 500 @Router /documents/search_category/{category_id} [get] @Security public
func (*DocumentsHandler) GetDocumentsByClubID ¶
func (h *DocumentsHandler) GetDocumentsByClubID(w http.ResponseWriter, req *http.Request) handler.Response
GetDocumentsByClubID retrieves a slice of documents by its club ID
@Summary Retrieve documents by club ID @Description Get documents corresponding to a certain club ID (0 for main page) @Tags public.documents @Produce json @Param club_id path string true "club_id" @Success 200 {object} responses.GetDocumentsByClubID @Failure 400 @Failure 404 @Failure 500 @Router /documents/search_club/{club_id} [get] @Security public
func (*DocumentsHandler) PostCategory ¶
func (h *DocumentsHandler) PostCategory(w http.ResponseWriter, req *http.Request) handler.Response
PostCategory creates a new document category
@Summary Create a new document category @Description Create a new category for documents with given name @Tags auth.documents @Accept json @Param request body requests.PostDocumentCategory true "DocumentCategory data" @Success 201 @Failure 400 @Failure 401 @Failure 409 @Failure 500 @Router /documents/categories/ [post] @Security Authorised
func (*DocumentsHandler) PostDocument ¶
func (h *DocumentsHandler) PostDocument(w http.ResponseWriter, req *http.Request) handler.Response
PostDocument creates a new document item
@Summary Create a new document item @Description Create a new document item with the provided data and returns the key for it @Tags auth.documents @Accept json @Produce json @Param request body requests.PostDocument true "Document data" @Success 201 {object} responses.PostDocument @Failure 400 @Failure 401 @Failure 409 @Failure 500 @Router /documents/ [post] @Security Authorised
func (*DocumentsHandler) Routes ¶
func (h *DocumentsHandler) Routes() chi.Router
func (*DocumentsHandler) UpdateCategory ¶
func (h *DocumentsHandler) UpdateCategory(w http.ResponseWriter, req *http.Request) handler.Response
UpdateCategory updates a document category
@Summary Update a document category @Description Update an existing document category with the provided data @Tags auth.documents @Accept json @Param id path string true "DocumentCategory ID" @Param request body requests.PostDocumentCategory true "DocumentCategory new data" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 409 @Failure 500 @Router /documents/categories/{id} [put] @Security Authorised
func (*DocumentsHandler) UpdateDocument ¶
func (h *DocumentsHandler) UpdateDocument(w http.ResponseWriter, req *http.Request) handler.Response
UpdateDocument updates a document item
@Summary Update a document item @Description Update an existing document item with the provided data and returns the new key for it @Tags auth.documents @Accept json @Produce json @Param id path string true "Document ID" @Param request body requests.PostDocument true "Document new data" @Success 200 {object} responses.UpdateDocument @Failure 400 @Failure 401 @Failure 409 @Failure 404 @Failure 500 @Router /documents/{id} [put] @Security Authorised
type EventsHandler ¶
type EventsHandler struct {
// contains filtered or unexported fields
}
func NewEventsHandler ¶
func NewEventsHandler(r handler.Renderer, events app.EventsService, logger *log.Logger, guard *app.GuardService) *EventsHandler
func (*EventsHandler) BasePrefix ¶
func (h *EventsHandler) BasePrefix() string
func (*EventsHandler) DeleteEvent ¶
func (h *EventsHandler) DeleteEvent(w http.ResponseWriter, req *http.Request) handler.Response
DeleteEvent deletes an event item by ID
@Summary Delete an event item by ID @Description Delete a specific event item using its ID @Tags auth.events @Param id path string true "Event ID" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /events/{id} [delete] @Security Authorised
func (*EventsHandler) GetAllEvents ¶
func (h *EventsHandler) GetAllEvents(w http.ResponseWriter, req *http.Request) handler.Response
GetAllEvents retrieves all events items
@Summary Retrieve all events items @Description Get a list of all events items @Tags public.events @Produce json @Success 200 {object} responses.GetAllEvents @Failure 404 @Failure 500 @Router /events/ [get] @Security public
func (*EventsHandler) GetEvent ¶
func (h *EventsHandler) GetEvent(w http.ResponseWriter, req *http.Request) handler.Response
GetEvent retrieves an event item by its ID
@Summary Retrieve event item by ID @Description Get a specific event item using its ID @Tags public.events @Produce json @Param id path string true "id" @Success 200 {object} responses.GetEvent @Failure 400 @Failure 404 @Failure 500 @Router /events/{id} [get] @Security public
func (*EventsHandler) GetEventsByRange ¶
func (h *EventsHandler) GetEventsByRange(w http.ResponseWriter, req *http.Request) handler.Response
GetEventsByRange retrieves an array of events in the given time range
@Summary Retrieve events items by range @Description Given a start time and end time recieve events in that period @Tags public.events @Accept json @Produce json @Param request body requests.GetEventsByRange true "Range" @Success 200 {object} responses.GetEventsByRange @Failure 400 @Failure 404 @Failure 500 @Router /events/range/ [get] @Security public
func (*EventsHandler) PostEvent ¶
func (h *EventsHandler) PostEvent(w http.ResponseWriter, req *http.Request) handler.Response
PostEvent creates a new event item
@Summary Create a new event item @Description Create a new event item with the provided data @Tags auth.events @Accept json @Param request body requests.PostEvent true "Event data" @Success 201 @Failure 400 @Failure 401 @Failure 500 @Router /events/ [post] @Security Authorised
func (*EventsHandler) Routes ¶
func (h *EventsHandler) Routes() chi.Router
func (*EventsHandler) UpdateEvent ¶
func (h *EventsHandler) UpdateEvent(w http.ResponseWriter, req *http.Request) handler.Response
UpdateEvent updates a event item
@Summary Update a event item @Description Update an existing event item with the provided data @Tags auth.events @Accept json @Param id path string true "Event ID" @Param request body requests.PostEvent true "Event new data" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /events/{id} [put] @Security Authorised
type FeedHandler ¶
type FeedHandler struct {
// contains filtered or unexported fields
}
func NewFeedHandler ¶
func NewFeedHandler(r handler.Renderer, feed app.FeedService, logger *log.Logger, guard *app.GuardService) *FeedHandler
func (*FeedHandler) BasePrefix ¶
func (h *FeedHandler) BasePrefix() string
func (*FeedHandler) DeleteEncounter ¶
func (h *FeedHandler) DeleteEncounter(w http.ResponseWriter, req *http.Request) handler.Response
DeleteEncounter deletes an encounter item by ID
@Summary Delete a encounter item by ID @Description Delete a specific encounter item using its ID @Tags auth.feed @Param id path string true "Encounter ID" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /feed/encounters/{id} [delete] @Security Authorised
func (*FeedHandler) DeleteFeed ¶
func (h *FeedHandler) DeleteFeed(w http.ResponseWriter, req *http.Request) handler.Response
@Router /feed/{id} [delete] @Security Authorised
func (*FeedHandler) GetAllFeed ¶
func (h *FeedHandler) GetAllFeed(w http.ResponseWriter, req *http.Request) handler.Response
GetAllFeed retrieves all feed items
@Summary Retrieve all feed items @Description Get a list of all feed items @Tags public.feed @Produce json @Success 200 {object} responses.GetAllFeed @Failure 404 @Failure 500 @Router /feed/ [get] @Security public
func (*FeedHandler) GetFeed ¶
func (h *FeedHandler) GetFeed(w http.ResponseWriter, req *http.Request) handler.Response
GetFeed retrieves a feed item by its ID
@Summary Retrieve feed item by ID @Description Get a specific feed item using its ID @Tags public.feed @Produce json @Param id path string true "id" @Success 200 {object} responses.GetFeed @Failure 400 @Failure 404 @Failure 500 @Router /feed/{id} [get] @Security public
func (*FeedHandler) GetFeedByTitle ¶
func (h *FeedHandler) GetFeedByTitle(w http.ResponseWriter, req *http.Request) handler.Response
GetFeedByTitle retrieves feed items by title
@Summary Retrieve feed items by title @Description Get feed items that match the specified title @Tags public.feed @Produce json @Param title path string true "title" @Success 200 {object} responses.GetFeedByTitle @Failure 400 @Failure 404 @Router /feed/search/{title} [get] @Security public
func (*FeedHandler) GetFeedEncounters ¶
func (h *FeedHandler) GetFeedEncounters(w http.ResponseWriter, req *http.Request) handler.Response
GetFeedEncounters retrieves by club_id
@Summary Retrieve encounters by club_id @Description Get all encounters for a given club (0 for main page) @Tags public.feed @Produce json @Param club_id path string true "club_id" @Success 200 {object} responses.GetFeedEncounters @Failure 400 @Failure 404 @Router /feed/encounters/{club_id} [get] @Security public
func (*FeedHandler) PostEncounter ¶
func (h *FeedHandler) PostEncounter(w http.ResponseWriter, req *http.Request) handler.Response
PostEncounter creates a new encounter item
@Summary Create a new encounter item @Description Create a new encounter item with the provided data @Tags auth.feed @Accept json @Param request body requests.PostEncounter true "Encounter data" @Success 201 @Failure 400 @Failure 401 @Failure 500 @Router /feed/encounters/ [post] @Security Authorised
func (*FeedHandler) PostFeed ¶
func (h *FeedHandler) PostFeed(w http.ResponseWriter, req *http.Request) handler.Response
PostFeed creates a new feed item
@Summary Create a new feed item @Description Create a new feed item with the provided data @Tags auth.feed @Accept json @Param request body requests.PostFeed true "Feed data" @Success 201 @Failure 400 @Failure 401 @Failure 500 @Router /feed/ [post] @Security Authorised
func (*FeedHandler) Routes ¶
func (h *FeedHandler) Routes() chi.Router
func (*FeedHandler) UpdateEncounter ¶
func (h *FeedHandler) UpdateEncounter(w http.ResponseWriter, req *http.Request) handler.Response
UpdateEncounter updates an encounter item
@Summary Update an encounter item @Description Update an existing encounter item with the provided data @Tags auth.feed @Accept json @Param id path string true "Encounter ID" @Param request body requests.PostEncounter true "Encounter new data" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /feed/encounters/{id} [put] @Security Authorised
func (*FeedHandler) UpdateFeed ¶
func (h *FeedHandler) UpdateFeed(w http.ResponseWriter, req *http.Request) handler.Response
UpdateFeed updates a feed item
@Summary Update a feed item @Description Update an existing feed item with the provided data @Tags auth.feed @Accept json @Param id path string true "Feed ID" @Param request body requests.PostFeed true "Feed new data" @Success 200 @Failure 400 @Failure 401 @Failure 500 @Router /feed/{id} [put] @Security Authorised
type GuardHandler ¶
type GuardHandler struct {
// contains filtered or unexported fields
}
func NewGuardHandler ¶
func NewGuardHandler(r handler.Renderer, guard app.GuardService, logger *log.Logger) *GuardHandler
func (*GuardHandler) BasePrefix ¶
func (h *GuardHandler) BasePrefix() string
func (*GuardHandler) LoginUser ¶
func (h *GuardHandler) LoginUser(w http.ResponseWriter, req *http.Request) handler.Response
LoginUser
@Summary Авторизирует пользователя @Description Авторизует пользователя в системе, оставляя куку с токеном авторизации. @Tags public.guard @Param request body requests.LoginRequest true "login user data" @Success 200 @Failure 400 @Failure 500 @Router /guard/login [post] @Security Public
func (*GuardHandler) LogoutUser ¶
func (h *GuardHandler) LogoutUser(w http.ResponseWriter, req *http.Request) handler.Response
LogoutUser
@Summary Выход из системы @Description Выход из системы, удалением сессии из кеша. Кука на стороне пользователя остается, но по ней нельзя будет взаимодействовать. @Tags auth.guard @Success 201 @Failure 401 @Failure 500 @Router /guard/logout [post] @Security Authorized
func (*GuardHandler) RegisterUser ¶
func (h *GuardHandler) RegisterUser(w http.ResponseWriter, req *http.Request) handler.Response
RegisterUser
@Summary Регистрация нового пользователя @Description Регистрация нового пользователя в системе без админки. По умолчанию создается случайная аватарка из дефолтных. После регистрации пытается авторизоваться, но в случае ошибки авторизации все равно вернет 201. @Tags public.guard @Param request body requests.Register true "register user data" @Success 200 @Failure 400 @Failure 409 @Failure 500 @Router /guard/register [post] @Security Public
func (*GuardHandler) Routes ¶
func (h *GuardHandler) Routes() chi.Router
type MediaHandler ¶
type MediaHandler struct {
// contains filtered or unexported fields
}
func NewMediaHandler ¶
func NewMediaHandler(r handler.Renderer, media *app.MediaService, logger *log.Logger, guard *app.GuardService) *MediaHandler
func (*MediaHandler) BasePrefix ¶
func (h *MediaHandler) BasePrefix() string
func (*MediaHandler) DeleteMediaDefault ¶
func (h *MediaHandler) DeleteMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
DeleteMediaDefault
@Summary Удаляет дефолтное изображение из базы данных @Description Удаляет дефолтное изображение их базы данных @Tags auth.media @Produce json @Param id path int true "id" @Success 200 @Failure 400 @Failure 401 @Failure 500
@Router /media/default/ [delete] @Security Authorized
func (*MediaHandler) GetMediaDefault ¶
func (h *MediaHandler) GetMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
GetMediaDefault
@Summary Возвращает все дефольные изображения @Description Возвращает все дефольные изображения @Tags public.media @Produce json @Success 200 {object} responses.GetAllDefaultMedia @Failure 404 @Router /media/default [get] @Security Public
func (*MediaHandler) GetMediaDefaultByID ¶
func (h *MediaHandler) GetMediaDefaultByID(w http.ResponseWriter, req *http.Request) handler.Response
GetMediaDefaultByID
@Summary Возвращает дефолтное изображение по ID @Description Возвращает дефолтное изображение по ID @Tags public.media @Produce json @Param id path int true "id" @Success 200 {object} responses.GetDefaultMedia @Failure 400 @Failure 404
@Router /media/default/{id} [get] @Security Public
func (*MediaHandler) PostMediaDefault ¶
func (h *MediaHandler) PostMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
PostMediaDefault
@Summary Загружает дефолтное изображение в базу данных @Description Загружает дефолтное изображение в базу данных @Tags auth.media @Produce json @Param request body requests.PostDefaultMedia true "post media data" @Success 200 {object} responses.PostDefaultMedia @Failure 400 @Failure 401 @Failure 409 @Failure 500
@Router /media/default/ [post] @Security Authorized
func (*MediaHandler) PostMediaPrivate ¶
func (h *MediaHandler) PostMediaPrivate(w http.ResponseWriter, req *http.Request) handler.Response
PostMediaPrivate
@Summary Загружает изображение в базу данных @Description Загружает изображение в базу данных приватно, то есть название загруженного файла и хранящегося объетка различаются. По сути из вне нельзя заранее узнать ключ для получения файла. @Tags auth.media @Produce json @Param request body requests.PostMedia true "post media data" @Success 200 {object} responses.PostMedia @Failure 400 @Failure 401 @Failure 500 @Router /media/private [post] @Security Authorized
func (*MediaHandler) PostMediaPublic ¶
func (h *MediaHandler) PostMediaPublic(w http.ResponseWriter, req *http.Request) handler.Response
PostMediaPublic
@Summary Загружает изображение в базу данных @Description Загружает изображение в базу данных публично, то есть в хранилище хранится файл по тому же названию, что и подан на вход. @Tags auth.media @Produce json @Param request body requests.PostMedia true "post media data" @Success 200 {object} responses.PostMedia @Failure 400 @Failure 401 @Failure 500 @Router /media/public [post] @Security Authorized
func (*MediaHandler) Routes ¶
func (h *MediaHandler) Routes() chi.Router
func (*MediaHandler) UpdateMediaDefault ¶
func (h *MediaHandler) UpdateMediaDefault(w http.ResponseWriter, req *http.Request) handler.Response
UpdateMediaDefault
@Summary Обновляет дефолтное изображение в базе данных @Description Обновляет дефолтное изображение в базе данных @Tags auth.media @Produce json @Param id path int true "id" @Param request body requests.UpdateDefaultMedia true "post media data" @Success 200 @Failure 400 @Failure 401 @Failure 409 @Failure 500
@Router /media/default/ [put] @Security Authorized
type MembersHandler ¶
type MembersHandler struct {
// contains filtered or unexported fields
}
func NewMembersHandler ¶
func NewMembersHandler(r handler.Renderer, members app.MembersService, logger *log.Logger, guard *app.GuardService) *MembersHandler
func (*MembersHandler) BasePrefix ¶
func (h *MembersHandler) BasePrefix() string
func (*MembersHandler) DeleteMember ¶
func (h *MembersHandler) DeleteMember(w http.ResponseWriter, req *http.Request) handler.Response
DeleteMember deletes a member by ID
@Summary Delete a member by ID @Description Delete a member using its ID @Tags auth.members @Produce json @Param id path string true "Member ID" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /members/{id} [delete] @Security Authorised
func (*MembersHandler) GetAllMembers ¶
func (h *MembersHandler) GetAllMembers(w http.ResponseWriter, req *http.Request) handler.Response
GetAllMembers retrieves all members
@Summary Retrieve all members @Description Get a list of all members @Tags auth.members @Produce json @Success 200 {object} responses.GetAllMembers @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /members/ [get] @Security Authorised
func (*MembersHandler) GetMember ¶
func (h *MembersHandler) GetMember(w http.ResponseWriter, req *http.Request) handler.Response
GetMember retrieves a member by ID
@Summary Retrieve member by ID @Description Get a specific member using its ID @Tags auth.members @Produce json @Param id path string true "Member ID" @Success 200 {object} responses.GetMember @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /members/{id} [get] @Security Authorised
func (*MembersHandler) GetMembersByName ¶
func (h *MembersHandler) GetMembersByName(w http.ResponseWriter, req *http.Request) handler.Response
GetMembersByName retrieves members by name
@Summary Retrieve members by name @Description Get members that match the specified name @Tags auth.members @Produce json @Param name path string true "Member name" @Success 200 {array} responses.GetMembersByName @Failure 400 @Failure 401 @Failure 404 @Failure 500 @Router /members/search/{name} [get] @Security Authorised
func (*MembersHandler) Routes ¶
func (h *MembersHandler) Routes() chi.Router
func (*MembersHandler) UpdateMember ¶
func (h *MembersHandler) UpdateMember(w http.ResponseWriter, req *http.Request) handler.Response
UpdateMember updates a member's information
@Summary Update a member's information @Description Update a member's information with the provided data @Tags auth.members @Accept json @Param request body requests.UpdateMember true "Member data" @Success 200 @Failure 400 @Failure 401 @Failure 404 @Failure 409 @Failure 500 @Router /members/update [put] @Security Authorised
type SwagHandler ¶
type SwagHandler struct {
// contains filtered or unexported fields
}
func NewSwagHandler ¶
func NewSwagHandler(r handler.Renderer) *SwagHandler
func (*SwagHandler) BasePrefix ¶
func (h *SwagHandler) BasePrefix() string
func (*SwagHandler) Routes ¶
func (h *SwagHandler) Routes() chi.Router