Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewArticleHandler ¶
func NewArticleHandler(e *echo.Echo, svc ArticleService)
NewArticleHandler will initialize the articles/ resources endpoint
func NewVideoHandler ¶
func NewVideoHandler(e *echo.Echo, svc VideoService)
NewVideoHandler will initialize the videos/ resources endpoint
Types ¶
type ArticleHandler ¶
type ArticleHandler struct {
Service ArticleService
}
ArticleHandler represent the httphandler for article
func (*ArticleHandler) Delete ¶
func (a *ArticleHandler) Delete(c echo.Context) error
Delete will delete article by given param
func (*ArticleHandler) FetchArticle ¶
func (a *ArticleHandler) FetchArticle(c echo.Context) error
FetchArticle will fetch the article based on given params
func (*ArticleHandler) GetByID ¶
func (a *ArticleHandler) GetByID(c echo.Context) error
GetByID will get article by given id
func (*ArticleHandler) Store ¶
func (a *ArticleHandler) Store(c echo.Context) (err error)
Store will store the article by given request body
type ArticleService ¶
type ArticleService interface { Fetch(ctx context.Context, cursor string, num int64) ([]domain.Article, string, error) GetByID(ctx context.Context, id int64) (domain.Article, error) Update(ctx context.Context, ar *domain.Article) error GetByTitle(ctx context.Context, title string) (domain.Article, error) Store(context.Context, *domain.Article) error Delete(ctx context.Context, id int64) error }
ArticleService represent the article's usecases
type ResponseError ¶
type ResponseError struct {
Message string `json:"message"`
}
ResponseError represent the response error struct
type VideoHandler ¶
type VideoHandler struct {
Service VideoService
}
VideoHandler represent the httphandler for video
func (*VideoHandler) HandleStreamWs ¶
func (a *VideoHandler) HandleStreamWs(c echo.Context) error
func (*VideoHandler) SearchVideos ¶
func (a *VideoHandler) SearchVideos(c echo.Context) error
FetchVideo will fetch the video based on given params
type VideoService ¶
type VideoService interface { SearchVideos(ctx context.Context, text string, amount int64) ([]domain.SearchedVideo, error) GetStreamReader(ctx context.Context) (io.ReadCloser, error) }
VideoService represent the video's usecases
Click to show internal directories.
Click to hide internal directories.