dashboard

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateInput

type CreateInput struct {
	Name        string
	Description string
	Columns     int
	Widgets     []domain.Widget
}

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

func (s *Service) Delete(ctx context.Context, tenantID, userID, id string) error

Delete removes one of the caller's dashboards.

func (*Service) Get

func (s *Service) Get(ctx context.Context, tenantID, userID, id string) (*domain.Dashboard, error)

Get returns one of the caller's dashboards.

func (*Service) List

func (s *Service) List(ctx context.Context, tenantID, userID string) ([]*domain.Dashboard, error)

List returns every dashboard owned by the caller.

func (*Service) SetDefault

func (s *Service) SetDefault(ctx context.Context, tenantID, userID, id string) error

SetDefault marks one of the caller's dashboards as their default.

func (*Service) Update

func (s *Service) Update(ctx context.Context, tenantID, userID, id string, in CreateInput) (*domain.Dashboard, error)

Update replaces the name and layout of one of the caller's dashboards.

Jump to

Keyboard shortcuts

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