Documentation
¶
Index ¶
- type Course
- type CourseRepository
- type DeletedCourse
- type Service
- func (s *Service) Course(_ context.Context, courseUUID uuid.UUID) (Course, error)
- func (s *Service) Courses(_ context.Context) ([]Course, error)
- func (s *Service) CreateCourse(_ context.Context, course *Course) error
- func (s *Service) DeleteCourse(_ context.Context, course *DeletedCourse) error
- func (s *Service) UpdateCourse(_ context.Context, course *Course) error
- type ServiceConfiguration
- type ServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Course ¶
type Course struct {
UUID uuid.UUID `json:"uuid"`
Code string `json:"code"`
Name string `json:"name"`
Underline string `json:"underline"`
Image string `json:"image,omitempty"`
ImageCover string `db:"image_cover" json:"image_cover,omitempty"`
Excerpt string `json:"excerpt"`
Description string `json:"description,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type CourseRepository ¶
type DeletedCourse ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cfgs ...ServiceConfiguration) (*Service, error)
NewService creates a new domain Service instance.
func (*Service) CreateCourse ¶
func (*Service) DeleteCourse ¶
func (s *Service) DeleteCourse(_ context.Context, course *DeletedCourse) error
type ServiceConfiguration ¶
func WithCourseRepository ¶
func WithCourseRepository(cr CourseRepository) ServiceConfiguration
WithCourseRepository injects the course repository to the domain Service.
func WithLogger ¶
func WithLogger(l log.Logger) ServiceConfiguration
WithLogger injects the logger to the domain Service.
type ServiceInterface ¶
type ServiceInterface interface {
Course(ctx context.Context, id uuid.UUID) (Course, error)
Courses(ctx context.Context) ([]Course, error)
CreateCourse(ctx context.Context, course *Course) error
UpdateCourse(ctx context.Context, course *Course) error
DeleteCourse(ctx context.Context, course *DeletedCourse) error
}
ServiceInterface defines the domains Service interface.
Click to show internal directories.
Click to hide internal directories.