Documentation
¶
Overview ¶
Package dashboard is the application service for per-user customizable dashboards (RFC-021). It is a thin wrapper over the domain repository whose sole job is to parse identifiers and enforce that every operation is scoped to the authenticated (tenant, user) — ownership is never taken from a request body.
Index ¶
- type CreateInput
- type Service
- func (s *Service) Create(ctx context.Context, tenantID, userID string, in CreateInput) (*domain.Dashboard, error)
- func (s *Service) Delete(ctx context.Context, tenantID, userID, id string) error
- func (s *Service) Get(ctx context.Context, tenantID, userID, id string) (*domain.Dashboard, error)
- func (s *Service) List(ctx context.Context, tenantID, userID string) ([]*domain.Dashboard, error)
- func (s *Service) SetDefault(ctx context.Context, tenantID, userID, id string) error
- func (s *Service) Update(ctx context.Context, tenantID, userID, id string, in CreateInput) (*domain.Dashboard, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
CreateInput carries the fields for creating or replacing a dashboard.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides per-user dashboard CRUD.
func NewService ¶
func NewService(repo domain.Repository, log *logger.Logger) *Service
NewService creates a dashboard Service.
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, tenantID, userID string, in CreateInput) (*domain.Dashboard, error)
Create persists a new dashboard for the caller.
func (*Service) SetDefault ¶
SetDefault marks one of the caller's dashboards as their default.