database

package
v0.0.0-...-1019c43 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryDB

type CategoryDB struct {
	ID          string
	Name        string
	Description string
	// contains filtered or unexported fields
}

func NewCategoryDB

func NewCategoryDB(db *sql.DB) *CategoryDB

func (*CategoryDB) FindAllCategory

func (category *CategoryDB) FindAllCategory() ([]CategoryDB, error)

func (*CategoryDB) FindCategoryByCourseID

func (category *CategoryDB) FindCategoryByCourseID(courseId string) (*CategoryDB, error)

func (*CategoryDB) RegisterCategory

func (category *CategoryDB) RegisterCategory(name, description string) (CategoryDB, error)

type CourseDB

type CourseDB struct {
	ID          string
	Name        string
	Description string
	CategoryID  string
	// contains filtered or unexported fields
}

func NewCourseDB

func NewCourseDB(db *sql.DB) *CourseDB

func (*CourseDB) FindAllCourse

func (courseDB *CourseDB) FindAllCourse() ([]CourseDB, error)

func (*CourseDB) FindAllCourseByCategoryID

func (courseDB *CourseDB) FindAllCourseByCategoryID(categoryId string) ([]CourseDB, error)

func (*CourseDB) RegisterCourse

func (courseDB *CourseDB) RegisterCourse(name, description, categoryID string) (*CourseDB, error)

Jump to

Keyboard shortcuts

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