Documentation ¶
Index ¶
- type Api
- type AuthResource
- type ConcertsResource
- func (rs ConcertsResource) Create(w http.ResponseWriter, r *http.Request)
- func (rs ConcertsResource) Get(w http.ResponseWriter, r *http.Request)
- func (rs ConcertsResource) GetAll(w http.ResponseWriter, r *http.Request)
- func (rs ConcertsResource) Routes() chi.Router
- func (rs ConcertsResource) Update(w http.ResponseWriter, r *http.Request)
- type TicketsResource
- func (rs TicketsResource) Create(w http.ResponseWriter, r *http.Request)
- func (rs TicketsResource) Get(w http.ResponseWriter, r *http.Request)
- func (rs TicketsResource) GetAll(w http.ResponseWriter, r *http.Request)
- func (rs TicketsResource) GetAllOwn(w http.ResponseWriter, r *http.Request)
- func (rs TicketsResource) Routes() chi.Router
- func (rs TicketsResource) Update(w http.ResponseWriter, r *http.Request)
- func (rs TicketsResource) UpdateToken(w http.ResponseWriter, r *http.Request)
- type UsersResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResource ¶
type AuthResource struct {
// contains filtered or unexported fields
}
func (AuthResource) Routes ¶
func (rs AuthResource) Routes() chi.Router
type ConcertsResource ¶
type ConcertsResource struct {
// contains filtered or unexported fields
}
func (ConcertsResource) Create ¶
func (rs ConcertsResource) Create(w http.ResponseWriter, r *http.Request)
@Summary Creates new concert @Tags Concerts @Param concert body domain.Concert true "Concert to create" @Security BearerAuth @Router /concerts [post]
func (ConcertsResource) Get ¶
func (rs ConcertsResource) Get(w http.ResponseWriter, r *http.Request)
@Summary Returns concert info @Tags Concerts @Param id path integer true "Concert id" @Router /concerts/{id} [get]
func (ConcertsResource) GetAll ¶
func (rs ConcertsResource) GetAll(w http.ResponseWriter, r *http.Request)
@Summary Returns list of concerts @Description Returns list of 10 last concerts in db oredered by concert_id. @Description Use last_id query parameter to select concerts before this last_id @Tags Concerts @Param last_id query integer false "id before which to get last concerts" @Router /concerts [get]
func (ConcertsResource) Routes ¶
func (rs ConcertsResource) Routes() chi.Router
func (ConcertsResource) Update ¶
func (rs ConcertsResource) Update(w http.ResponseWriter, r *http.Request)
@Summary Updates concert info @Tags Concerts @Param id path integer true "Concert id" @Param concert body domain.Concert true "Updated concert info" @Security BearerAuth @Router /concerts/{id} [put]
type TicketsResource ¶
type TicketsResource struct {
// contains filtered or unexported fields
}
func (TicketsResource) Create ¶
func (rs TicketsResource) Create(w http.ResponseWriter, r *http.Request)
@Summary Creates new ticket @Tags Tickets @Param ticket body domain.Ticket true "Ticket to create" @Security BearerAuth @Router /tickets [post]
func (TicketsResource) Get ¶
func (rs TicketsResource) Get(w http.ResponseWriter, r *http.Request)
@Summary Returns ticket info @Tags Tickets @Param id path integer true "Ticket id" @Security BearerAuth @Router /tickets/{id} [get]
func (TicketsResource) GetAll ¶
func (rs TicketsResource) GetAll(w http.ResponseWriter, r *http.Request)
@Summary Returns list of tickets @Description Returns list of 10 last tickets in db oredered by ticket_id. @Description Use last_id query parameter to select tickets before this last_id @Tags Tickets @Param last_id query integer false "id before which to get last tickets" @Security BearerAuth @Router /tickets [get]
func (TicketsResource) GetAllOwn ¶
func (rs TicketsResource) GetAllOwn(w http.ResponseWriter, r *http.Request)
@Summary Returns list of tickets that user has @Description Returns list of 10 last tickets that the user has in db oredered by ticket_id. @Description Use last_id query parameter to select tickets before this last_id @Tags Tickets @Param last_id query integer false "id before which to get last tickets" @Security BearerAuth @Router /tickets/own [get]
func (TicketsResource) Routes ¶
func (rs TicketsResource) Routes() chi.Router
func (TicketsResource) Update ¶
func (rs TicketsResource) Update(w http.ResponseWriter, r *http.Request)
@Summary Updates ticket info @Tags Tickets @Param id path integer true "Ticket id" @Param ticket body domain.Ticket true "Updated ticket info" @Security BearerAuth @Router /tickets/{id} [put]
func (TicketsResource) UpdateToken ¶
func (rs TicketsResource) UpdateToken(w http.ResponseWriter, r *http.Request)
@Summary Updates ticket verification token @Tags Tickets @Param id path integer true "Ticket id" @Security BearerAuth @Router /tickets/{id}/token [put]
type UsersResource ¶
type UsersResource struct {
// contains filtered or unexported fields
}
func (UsersResource) Get ¶
func (rs UsersResource) Get(w http.ResponseWriter, r *http.Request)
func (UsersResource) GetAll ¶
func (rs UsersResource) GetAll(w http.ResponseWriter, r *http.Request)
func (UsersResource) Routes ¶
func (rs UsersResource) Routes() chi.Router