issues

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package issues owns the issue plane: the public feedback ingress the SDK posts to, and the per-route listing it reads back.

Index

Constants

View Source
const (
	TitleLimit = maxTitleBytes
	BodyLimit  = maxBodyBytes
)

RankFor and Truncate are the exported faces of the two helpers above, for code that files issues from OUTSIDE this package — today, the wizard's plan-import pass in internal/fleet. Exposed as wrappers rather than letting callers re-implement them, because the rank format carries the board's subdivision invariant (never ends in 'a') and truncate carries the rune-boundary fix; a second copy of either would drift.

TitleLimit and BodyLimit are the byte caps the columns are actually sized for, exported for the same reason — a caller inventing its own numbers would either reject titles this package accepts or trip the CHECK.

Variables

This section is empty.

Functions

func RankFor added in v0.1.1

func RankFor(n int64) string

func Truncate added in v0.1.1

func Truncate(s string, n int) string

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB, log *slog.Logger, origins []string, dev bool) *Service

func (*Service) PublicRoutes added in v0.3.0

func (s *Service) PublicRoutes(r chi.Router)

PublicRoutes carries the one surface that must answer an UNAUTHENTICATED request: feedback ingress.

It is split out because the fix that put every builder surface behind auth swept this route up with the rest, and the two intents look identical at the mount site. A widget on a customer's marketing page is used by visitors who have no account and never will — an authenticated ingress is a feedback widget that silently cannot receive feedback, which is indistinguishable from a working one until someone checks the table.

It is not unguarded. handleFeedback still enforces originAllowed() and underRateLimit(); what it does not require is a session. Everything that READS — the board, the listing, attachments — stays in Routes, behind auth, because "anyone may report a bug" and "anyone may read every bug ever filed" are different claims.

func (*Service) Routes

func (s *Service) Routes(r chi.Router)

func (*Service) SetAuth

func (s *Service) SetAuth(a *auth.Service)

SetAuth supplies the auth service so comments can be attributed to the signed-in user. Optional: without it every comment reads "anonymous".

Jump to

Keyboard shortcuts

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