Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func (*Handlers) BuildRouter ¶
@title HTTP JWT CRUD @version 1.0 @description Demonstrate HTTP with Middleware, JWT, SQLX and slog package @description Response Code Format : HTTP Status - Service Code - Response Code @contact.name Yohanes Catur @contact.url www.linkedin.com/in/yohanescatur @contact.email yohanescatur@gmail.com @Basepath /
func (*Handlers) GetAccessToken ¶
func (h *Handlers) GetAccessToken(w http.ResponseWriter, r *http.Request)
GetAccessToken godoc @Summary Get Access Token @Tags Token @Accept json @Produce json @Param Content-Type header string true "application/json" @Param X-Client-Key header string true "Client key provided by server" @Param X-Timestamp header string true "format: 2006-01-02T15:04:05+07:00" @Param X-Signature header string true "Generated Signature" @Success 200 {object} auth.TokenResponse @Failure 400 {object} response.Message @Failure 401 {object} response.Message @Router /v1.0/access-token [POST]
func (*Handlers) GetTodoList ¶
func (h *Handlers) GetTodoList(w http.ResponseWriter, r *http.Request)
GetTodoList godoc @Summary Todo List @Description Get list of todo @Tags Todo @Accept json @Produce json @Param Content-Type header string true "application/json" @Param Authorization header string true "Bearer token" @Param X-Client-Key header string true "Client Key provided by server" @Param X-Timestamp header string true "format: 2006-01-02T15:04:05+07:00" @Param X-Signature header string true "123425234" @Param ID path string false "ID of todo" @Success 200 {object} []database.TableTodos @Failure 404 {object} response.Message @Router /v1.0/todo [GET]
func (*Handlers) InitSwagger ¶
func (h *Handlers) InitSwagger()
func (*Handlers) NewTodo ¶
func (h *Handlers) NewTodo(w http.ResponseWriter, r *http.Request)
NewTodo godoc @Summary Add Todo item @Description.markdown todo_add @Tags Todo @Accept json @Produce json @Param Content-Type header string true "application/json" @Param Authorization header string true "Bearer token" @Param X-Client-Key header string true "Client Key provided by server" @Param X-Timestamp header string true "format: 2006-01-02T15:04:05+07:00" @Param X-Signature header string true "123425234" @Param request body todo.AddTodosRequest true "request" @Success 200 {object} database.TableTodos @Failure 400 {object} response.Message @Router /v1.0/todo [POST]