Documentation ¶
Index ¶
- type Server
- func (server *Server) CreateCategory(ctx *gin.Context)
- func (server *Server) CreateVideo(ctx *gin.Context)
- func (server *Server) GetCategories(ctx *gin.Context)
- func (server *Server) GetProfile(ctx *gin.Context)
- func (server *Server) GetRouter() *gin.Engine
- func (server *Server) GetSegments(ctx *gin.Context)
- func (server *Server) GetTokenMaker() token.TokenMaker
- func (server *Server) GetVideoDetails(ctx *gin.Context)
- func (server *Server) GetVideos(ctx *gin.Context)
- func (server *Server) Login(ctx *gin.Context)
- func (server *Server) Register(ctx *gin.Context)
- func (server *Server) RunDBMigration()
- func (server *Server) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CreateCategory ¶
CreateCategory godoc @Summary Create a new category @Description Create a new category @Tags category @Accept json @Produce json @Param Authorization header string true "Bearer token" @Param name body string true "Name" alphanum @Param description body string false "Description" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /categories [post]
func (*Server) CreateVideo ¶
CreateVideo godoc @Summary Create a new video @Description Create a new video @Tags video @Accept multipart/form-data @Produce json @Param Authorization header string true "Bearer token" @Param title formData string true "Title" @Param description formData string false "Description" @Param category_ids formData []uint64 true "CategoryIDs" @Param file formData file true "Media file" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos [post]
func (*Server) GetCategories ¶
GetCategories godoc @Summary Get all categories @Description Get all categories @Tags category @Accept json @Produce json @Param Authorization header string true "Bearer token" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /categories [get]
func (*Server) GetProfile ¶
GetProfile godoc @Summary Get current user profile @Description Get current user profile @Tags user @Accept json @Produce json @Param Authorization header string true "Bearer token" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /users/me [get]
func (*Server) GetSegments ¶
GetSegments godoc @Summary Get video segments @Description Get video segments @Tags video @Accept json @Produce json @Param id path int true "ID" @Param page query int false "Page" @Param limit query int false "Limit" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos/{id}/segments [get]
func (*Server) GetTokenMaker ¶
func (server *Server) GetTokenMaker() token.TokenMaker
func (*Server) GetVideoDetails ¶
GetVideoDetails godoc @Summary Get video details @Description Get video details @Tags video @Accept json @Produce json @Param id path int true "ID" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos/{id} [get]
func (*Server) GetVideos ¶
GetVideos godoc @Summary List videos by filters @Description List videos by filters @Tags video @Accept json @Produce json @Param page query int false "Page" @Param limit query int false "Limit" @Param user_id query int false "UserID" @Param status query string false "Status" @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /videos [get]
func (*Server) Login ¶
Login godoc @Summary Login @Description Login @Tags auth @Accept json @Produce json @Param username body string true "Username" alphanum @Param password body string true "Password" minlength(8) @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /auth/login [post]
func (*Server) Register ¶
Register godoc @Summary Register @Description Register @Tags user @Accept json @Produce json @Param username body string true "Username" alphanum @Param password body string true "Password" minlength(8) @Param full_name body string true "Full Name" minlength(8) @Param email body string true "Email" minlength(8) @Success 200 {object} successResponse @Failure 400,404,500 {object} errorResponse @Router /users/register [post]
func (*Server) RunDBMigration ¶
func (server *Server) RunDBMigration()