business

package
v0.0.0-...-e328feb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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 CategoryBusiness interface {
	Create(ctx context.Context, data *model.CreateCategoryParams) (*model.Category, error)
	GetAll(ctx context.Context) ([]model.Category, error)
}

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL