domain

package
v0.0.0-...-b35a4b1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithActivityRepository

func WithActivityRepository(ar ActivityRepository) serviceConfiguration

WithActivityRepository injects the course repository to the domain Service

func WithLogger

func WithLogger(l log.Logger) serviceConfiguration

WithLogger injects the logger to the domain Service

Types

type Activity

type Activity struct {
	ID          uint       `json:"id"`
	UUID        uuid.UUID  `json:"uuid"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	ContentID   uuid.UUID  `json:"content_id"`
	ContentType string     `json:"content_type"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	DeletedAt   *time.Time `json:"deleted_at"`
}

type ActivityRepository

type ActivityRepository interface {
	Activity(id uuid.UUID) (Activity, error)
	Activities() ([]Activity, error)
	CreateActivity(activity *Activity) error
	UpdateActivity(activity *Activity) error
	DeleteActivity(id uuid.UUID) error
}

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

func (s *Service) Activities(_ context.Context) ([]Activity, error)

func (*Service) Activity

func (s *Service) Activity(_ context.Context, id uuid.UUID) (Activity, error)

func (*Service) CreateActivity

func (s *Service) CreateActivity(_ context.Context, activity *Activity) error

func (*Service) DeleteActivity

func (s *Service) DeleteActivity(_ context.Context, id uuid.UUID) error

func (*Service) UpdateActivity

func (s *Service) UpdateActivity(_ context.Context, activity *Activity) error

type ServiceInterface

type ServiceInterface interface {
	Activity(ctx context.Context, id uuid.UUID) (Activity, error)
	Activities(ctx context.Context) ([]Activity, error)
	CreateActivity(ctx context.Context, activity *Activity) error
	UpdateActivity(ctx context.Context, activity *Activity) error
	DeleteActivity(ctx context.Context, id uuid.UUID) error
}

ServiceInterface defines the domains Service interface

Jump to

Keyboard shortcuts

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