Documentation
¶
Overview ¶
Package sharing tracks which users have granted which other users read-only access to their aggregated dashboard. It owns no opinion about what a dashboard is — internal/api resolves a share into an actual dashboard.Manager lookup.
Index ¶
- type Store
- func (s *Store) DeleteUser(ctx context.Context, userID []byte) error
- func (s *Store) Init(ctx context.Context) error
- func (s *Store) IsSharedWith(ctx context.Context, ownerID, viewerID []byte) (bool, error)
- func (s *Store) Share(ctx context.Context, ownerID, viewerID []byte) error
- func (s *Store) SharedWith(ctx context.Context, ownerID []byte) ([][]byte, error)
- func (s *Store) SharedWithMe(ctx context.Context, viewerID []byte) ([][]byte, error)
- func (s *Store) Unshare(ctx context.Context, ownerID, viewerID []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists sharing relationships: ownerID has shared their dashboard with viewerID.
func (*Store) DeleteUser ¶
DeleteUser removes every share userID appears in, as either owner or viewer — used when an admin removes an account outright.
func (*Store) Init ¶
Init creates the schema if it doesn't already exist. Safe to call every startup.
func (*Store) IsSharedWith ¶
IsSharedWith reports whether ownerID has shared their dashboard with viewerID.
func (*Store) Share ¶
Share grants viewerID read access to ownerID's dashboard. Idempotent — sharing with the same viewer twice changes nothing.
func (*Store) SharedWith ¶
SharedWith returns every user ID ownerID has shared their dashboard with.
func (*Store) SharedWithMe ¶
SharedWithMe returns every user ID that has shared their dashboard with viewerID.