Documentation
¶
Index ¶
- func OpenDB(dbPath string) (*sql.DB, error)
- type ActorService
- func (s *ActorService) CreateActor(ctx context.Context, actor *domain.Actor) (int64, error)
- func (s *ActorService) GetActor(ctx context.Context, params *domain.GetActorParams) (*domain.Actor, error)
- func (s *ActorService) ListActors(ctx context.Context, params *domain.ListActorsParams) (*domain.Actors, error)
- func (s *ActorService) RemoveActor(ctx context.Context, params *domain.RemoveActorParams) (int64, error)
- func (s *ActorService) UpdateActor(ctx context.Context, actor *domain.Actor) (int64, error)
- type CustomerService
- func (s *CustomerService) CreateCustomer(ctx context.Context, customer *domain.Customer) (int64, error)
- func (s *CustomerService) GetCustomer(ctx context.Context, params *domain.GetCustomerParams) (*domain.Customer, error)
- func (s *CustomerService) ListCustomers(ctx context.Context, params *domain.ListCustomersParams) (*domain.Customers, error)
- func (s *CustomerService) RemoveCustomer(ctx context.Context, params *domain.RemoveCustomerParams) (int64, error)
- func (s *CustomerService) UpdateCustomer(ctx context.Context, customer *domain.Customer) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActorService ¶
type ActorService struct {
// contains filtered or unexported fields
}
ActorService represents a service for managing actors.
func NewActorService ¶
func NewActorService(db *sql.DB) *ActorService
NewActorService creates a new instance.
func (*ActorService) CreateActor ¶
CreateActor creates a new actor.
func (*ActorService) GetActor ¶
func (s *ActorService) GetActor( ctx context.Context, params *domain.GetActorParams, ) (*domain.Actor, error)
GetActor gets an actor. Returns ErrNotFound if the actor doesn't exist
func (*ActorService) ListActors ¶
func (s *ActorService) ListActors( ctx context.Context, params *domain.ListActorsParams, ) (*domain.Actors, error)
ListActors lists actors.
func (*ActorService) RemoveActor ¶
func (s *ActorService) RemoveActor(ctx context.Context, params *domain.RemoveActorParams) (int64, error)
RemoveActor removes an actor. Returns ErrNotFound if the actor doesn't exist
func (*ActorService) UpdateActor ¶
UpdateActor updates an actor. Returns ErrNotFound if the actor doesn't exist
type CustomerService ¶
type CustomerService struct {
// contains filtered or unexported fields
}
CustomerService represents a service for managing customers.
func NewCustomerService ¶
func NewCustomerService(db *sql.DB) *CustomerService
NewCustomerService creates a new instance.
func (*CustomerService) CreateCustomer ¶
func (s *CustomerService) CreateCustomer( ctx context.Context, customer *domain.Customer, ) (int64, error)
CreateCustomer creates a new customer.
func (*CustomerService) GetCustomer ¶
func (s *CustomerService) GetCustomer( ctx context.Context, params *domain.GetCustomerParams, ) (*domain.Customer, error)
GetCustomer gets a customer. Returns ErrNotFound if the customer doesn't exist
func (*CustomerService) ListCustomers ¶
func (s *CustomerService) ListCustomers( ctx context.Context, params *domain.ListCustomersParams, ) (*domain.Customers, error)
ListCustomers lists customers.
func (*CustomerService) RemoveCustomer ¶
func (s *CustomerService) RemoveCustomer( ctx context.Context, params *domain.RemoveCustomerParams, ) (int64, error)
RemoveCustomer removes a customer. Returns ErrNotFound if the customer doesn't exist
func (*CustomerService) UpdateCustomer ¶
func (s *CustomerService) UpdateCustomer( ctx context.Context, customer *domain.Customer, ) (int64, error)
UpdateCustomer updates a customer. Returns ErrNotFound if the customer doesn't exist