Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
web
command
|
|
|
Package e2e runs the real web binary against a fresh database and drives it over HTTP.
|
Package e2e runs the real web binary against a fresh database and drives it over HTTP. |
|
pkg
|
|
|
config
Package config declares every setting of the pcom binary as a go-flags option with paired `long:` and `env:` tags, so `web --help` is the configuration reference.
|
Package config declares every setting of the pcom binary as a go-flags option with paired `long:` and `env:` tags, so `web --help` is the configuration reference. |
|
logging
Package logging carries pcom's one logger, a *zap.Logger.
|
Package logging carries pcom's one logger, a *zap.Logger. |
|
mail
Package mail formats the mail pcom sends.
|
Package mail formats the mail pcom sends. |
|
markdown/mdext/strikethrough
Package strikethrough renders ~~text~~ as <del>text</del>.
|
Package strikethrough renders ~~text~~ as <del>text</del>. |
|
model
Package model holds pcom's database rows: one struct per table, written by hand.
|
Package model holds pcom's database rows: one struct per table, written by hand. |
|
proofread
Package proofread is what pcom asks a language model about a post and what it accepts back: the grammar check (suggestions to replace exact passages) and the style review (notes on the text as a whole, which follow up the post's previous review).
|
Package proofread is what pcom asks a language model about a post and what it accepts back: the grammar check (suggestions to replace exact passages) and the style review (notes on the text as a whole, which follow up the post's previous review). |
|
proofread/claude
Package claude is the proofread.Model over the Claude API, through the official Go SDK.
|
Package claude is the proofread.Model over the Claude API, through the official Go SDK. |
|
proofread/proofreadtest
Package proofreadtest is an in-memory proofread.Model for tests.
|
Package proofreadtest is an in-memory proofread.Model for tests. |
|
repo
Package repo holds database queries.
|
Package repo holds database queries. |
|
service
Package service holds the errors every service returns.
|
Package service holds the errors every service returns. |
|
service/accounts
Package accounts holds everything about who a user is and how they get in: signup, the waiting list, invitations, login credentials, passwords, the settings page, user styles, API keys, feed tokens and the registration switch.
|
Package accounts holds everything about who a user is and how they get in: signup, the waiting list, invitations, login credentials, passwords, the settings page, user styles, API keys, feed tokens and the registration switch. |
|
service/connections
Package connections manages who is connected to whom: whitelist grants (people allowed to connect without mediation), connections themselves and mediation requests, where common connections vouch for a stranger.
|
Package connections manages who is connected to whom: whitelist grants (people allowed to connect without mediation), connections themselves and mediation requests, where common connections vouch for a stranger. |
|
service/feeds
Package feeds manages RSS subscriptions: what a user follows, the items the poller delivers to them, and dismissing an item.
|
Package feeds manages RSS subscriptions: what a user follows, the items the poller delivers to them, and dismissing an item. |
|
service/graph
Package graph answers how two users are connected.
|
Package graph answers how two users are connected. |
|
service/media
Package media handles media uploads.
|
Package media handles media uploads. |
|
service/posts
Package posts is everything users do with posts: write, edit, autosave, publish and delete them, comment on them, prompt others to write, export and import a blog, and the API v1 that does the same for scripts.
|
Package posts is everything users do with posts: write, edit, autosave, publish and delete them, comment on them, prompt others to write, export and import a blog, and the API v1 that does the same for scripts. |
|
service/proofread
Package proofread is the grammar check and the style review of a post the author is writing: it enforces the per-user hourly limits and the site's daily cap, records every call to the model, keeps a post's style reviews and the status of their notes, and ties the model's answers to the text (pkg/proofread).
|
Package proofread is the grammar check and the style review of a post the author is writing: it enforces the per-user hourly limits and the site's daily cap, records every call to the model, keeps a post's style reviews and the status of their notes, and ties the model's answers to the text (pkg/proofread). |
|
service/reading
Package reading decides who may read what: a single post with its comments, a user's journal, the explore page, the feed and the RSS feeds built from them.
|
Package reading decides who may read what: a single post with its comments, a user's journal, the explore page, the feed and the RSS feeds built from them. |
|
service/registry
Package registry builds every service over one store.
|
Package registry builds every service over one store. |
|
service/shares
Package shares manages share links: a secret URL that shows one published post to anybody who has it, logged in or not.
|
Package shares manages share links: a secret URL that shows one published post to anybody who has it, logged in or not. |
|
testutil
Package testutil holds the smallest, most widely used test helper: Must.
|
Package testutil holds the smallest, most widely used test helper: Must. |
|
testutil/factory
Package factory builds valid rows for pcom's tables so that tests (and cmd/seed) don't have to know the schema.
|
Package factory builds valid rows for pcom's tables so that tests (and cmd/seed) don't have to know the schema. |
|
testutil/fakesender
Package fakesender is a fake of github.com/can3p/pcom/pkg/repo.MailQueue for unit and package tests: it records every mail instead of delivering it.
|
Package fakesender is a fake of github.com/can3p/pcom/pkg/repo.MailQueue for unit and package tests: it records every mail instead of delivering it. |
|
testutil/fakestorage
Package fakestorage is an in-memory implementation of github.com/can3p/pcom/pkg/media/server.MediaStorage, for tests that exercise upload/download code without a real object store.
|
Package fakestorage is an in-memory implementation of github.com/can3p/pcom/pkg/media/server.MediaStorage, for tests that exercise upload/download code without a real object store. |
|
testutil/ginctx
Package ginctx builds a *gin.Context for a handler test, wired up the way cmd/web/main.go wires a real request: a cookie-backed session under the name "sess".
|
Package ginctx builds a *gin.Context for a handler test, wired up the way cmd/web/main.go wires a real request: a cookie-backed session under the name "sess". |
|
testutil/golden
Package golden compares test output against a checked-in file, the convention docs/testing.md uses for mail content: run with UPDATE_GOLDEN=1 to write the file, and without it to check the current output still matches.
|
Package golden compares test output against a checked-in file, the convention docs/testing.md uses for mail content: run with UPDATE_GOLDEN=1 to write the file, and without it to check the current output still matches. |
|
testutil/seed
Package seed fills a development database with a small, named world that exercises every feature of pcom.
|
Package seed fills a development database with a small, named world that exercises every feature of pcom. |
|
testutil/testdb
Package testdb gives a test its own empty Postgres database with pcom's migrations applied.
|
Package testdb gives a test its own empty Postgres database with pcom's migrations applied. |
|
testutil/testlog
Package testlog records what code under test logs, so a test can assert on the entries.
|
Package testlog records what code under test logs, so a test can assert on the entries. |
|
testutil/tommy
Package tommy runs one tommy container (github.com/can3p/tommy) per test binary: the Mailjet API mail is sent to, and the S3 bucket user media is stored in.
|
Package tommy runs one tommy container (github.com/can3p/tommy) per test binary: the Mailjet API mail is sent to, and the S3 bucket user media is stored in. |
|
testutil/wiremock
Package wiremock runs one WireMock container per test binary.
|
Package wiremock runs one WireMock container per test binary. |
|
web/app
Package app assembles the web server: it wires the handlers of every area onto one gin engine.
|
Package app assembles the web server: it wires the handlers of every area onto one gin engine. |
Click to show internal directories.
Click to hide internal directories.