feedback

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package feedback implements the anonymous-feedback-to-GitHub-Issue proxy: a single IssueCreator interface backed by the GitHub Issues API, kept separate from the HTTP handler in server/feedback.go so the handler can be unit-tested against a fake creator.

Index

Constants

View Source
const (
	Owner = "sweetrpg"
	Repo  = "platform"
)

Owner and Repo identify the sweetrpg/platform meta-repo that every feedback submission becomes an issue on - see design.md's "no per-service repo routing" decision.

Variables

This section is empty.

Functions

func RateLimitMiddleware

func RateLimitMiddleware(pool *redis.Pool) gin.HandlerFunc

RateLimitMiddleware enforces a per-client budget on just the route it's mounted on, stricter than and layered on top of admin-api's existing service-wide limiter. Fails closed (503) if pool is nil or Redis is unreachable, matching api-core.go/ratelimit.Middleware's behavior.

Types

type GitHubIssueClient

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

GitHubIssueClient creates issues on sweetrpg/platform via the GitHub REST API using a service-owned token scoped to Issues:write on that one repo (see design.md).

func NewGitHubIssueClient

func NewGitHubIssueClient(token string) *GitHubIssueClient

NewGitHubIssueClient builds a client authenticated with the given token.

func (*GitHubIssueClient) CreateIssue

func (c *GitHubIssueClient) CreateIssue(ctx context.Context, title, body string, labels []string) error

CreateIssue creates a labeled issue on sweetrpg/platform. A non-nil error means the caller should treat the submission as failed (502/503) - this never retries internally, per design.md's "no partial state to reconcile" decision.

type IssueCreator

type IssueCreator interface {
	CreateIssue(ctx context.Context, title, body string, labels []string) error
}

IssueCreator creates a GitHub Issue from a feedback submission. Implemented by GitHubIssueClient; tests substitute a fake.

Jump to

Keyboard shortcuts

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