repository

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCategoryRepository

func NewCategoryRepository(db *gorm.DB) *categoryRepo

func NewRepository

func NewRepository(db *gorm.DB) *repository

func NewSessionRepository

func NewSessionRepository(db *gorm.DB) *sessionRepo

func NewUserRepository

func NewUserRepository(db *gorm.DB) *userRepo

func NewVideoRepository

func NewVideoRepository(db *gorm.DB) *videoRepo

Types

type CategoryRepository

type CategoryRepository interface {
	Create(ctx context.Context, data *model.Category) (*model.Category, error)
	GetByName(ctx context.Context, name string) (*model.Category, error)
	GetByIDs(ctx context.Context, ids []uint64) ([]model.Category, error)
	GetAll(ctx context.Context) ([]model.Category, error)
}

type Repository

type Repository interface {
	User() UserRepository
	Session() SessionRepository
	Category() CategoryRepository
	Video() VideoRepository
}

type SessionRepository

type SessionRepository interface {
	Create(ctx context.Context, data *model.Session) (*model.Session, error)
}

type UserRepository

type UserRepository interface {
	GetByUsername(ctx context.Context, username string) (*model.User, error)
	Create(ctx context.Context, data *model.User) (*model.User, error)
}

type VideoRepository

type VideoRepository interface {
	Create(ctx context.Context, data *model.Video) (*model.Video, error)
	Find(ctx context.Context, conds map[string]interface{}, moreInfo ...string) (*model.Video, error)
	List(
		ctx context.Context,
		filter *model.VideoFilter,
		paging *core.Paging,
		moreKeys ...string,
	) ([]model.Video, error)

	CreateVideoCategory(ctx context.Context, data *model.VideoCategory) (*model.VideoCategory, error)
	CreateVideoFile(ctx context.Context, data *model.VideoFile) (*model.VideoFile, error)
	GetVideoCategories(ctx context.Context, id uint64) ([]model.VideoCategory, error)
	GetVideoFile(ctx context.Context, id uint64) (*model.VideoFile, error)
}

Jump to

Keyboard shortcuts

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