Documentation ¶
Index ¶
- Variables
- func NewAuthBusiness(repo repository.Repository, tokenMaker token.TokenMaker) *authBusiness
- func NewBusiness(repo repository.Repository, tokenMaker token.TokenMaker) *business
- func NewCategoryBusiness(repo repository.Repository) *categoryBusiness
- func NewUserBusiness(repo repository.Repository) *userBusiness
- func NewVideoBusiness(repo repository.Repository) *videoBusiness
- type AuthBusiness
- type Business
- type CategoryBusiness
- type UserBusiness
- type VideoBusiness
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCategoryExisted = errors.New("category existed") ErrCannotCreateCategory = errors.New("cannot create category") ErrCannotGetCategories = errors.New("cannot get categories") )
View Source
var ( ErrUserExisted = errors.New("user existed") ErrCannotRegister = errors.New("cannot register") ErrCannotGetUser = errors.New("cannot get user") )
View Source
var ( ErrVideoTitleExisted = errors.New("video title already existed") ErrCategoryNotFound = errors.New("category not found") ErrCannotCreateVideo = errors.New("cannot create video") ErrCannotCreateVideoFile = errors.New("cannot create video file") ErrCannotCreateFile = errors.New("cannot create file") ErrCannotCopyFile = errors.New("cannot copy file") ErrCannotCreateOutputDir = errors.New("cannot create output directory") ErrCannotInitTranscoder = errors.New("cannot init transcoder") ErrCannotConvertMedia = errors.New("cannot convert media") ErrCannotListVideos = errors.New("cannot list videos") ErrVideoNotFound = errors.New("video not found") ErrVideoSegmentsNotFound = errors.New("video segments not found") ErrCannotReadFile = errors.New("cannot read file") ErrCannotRemoveTempFile = errors.New("cannot remove temp file") )
View Source
var (
ErrEmailOrPasswordInvalid = errors.New("email or password invalid")
)
Functions ¶
func NewAuthBusiness ¶
func NewAuthBusiness(repo repository.Repository, tokenMaker token.TokenMaker) *authBusiness
func NewBusiness ¶
func NewBusiness(repo repository.Repository, tokenMaker token.TokenMaker) *business
func NewCategoryBusiness ¶
func NewCategoryBusiness(repo repository.Repository) *categoryBusiness
func NewUserBusiness ¶
func NewUserBusiness(repo repository.Repository) *userBusiness
func NewVideoBusiness ¶
func NewVideoBusiness(repo repository.Repository) *videoBusiness
Types ¶
type AuthBusiness ¶
type AuthBusiness interface {
Login(ctx context.Context, data *model.LoginParams) (*model.LoginResponse, error)
}
type Business ¶
type Business interface { Auth() AuthBusiness User() UserBusiness Category() CategoryBusiness Video() VideoBusiness }
type CategoryBusiness ¶
type UserBusiness ¶
type UserBusiness interface { Register(ctx context.Context, data *model.CreateUserParams) (*model.UserResponse, error) GetProfile(ctx context.Context) (*model.UserResponse, error) }
type VideoBusiness ¶
type VideoBusiness interface { Create(ctx context.Context, data *model.CreateVideoParams, fileHeader *multipart.FileHeader) (uint64, error) GetByID(ctx context.Context, id uint64) (interface{}, error) List(ctx context.Context, filter *model.VideoFilter, paging *core.Paging) ([]model.Video, error) GetSegments(ctx context.Context, id uint64, paging *core.Paging) (interface{}, error) }
Click to show internal directories.
Click to hide internal directories.