# pkg/

Core domain logic and shared infrastructure.

## Patterns

- 1:1 mapping with YouTube API resources.
- Structure: `<resource>.go` + `<resource>_test.go` + `BUILD.bazel` (auto-generated by `bazel run //:gazelle` — do NOT edit manually).
- Domain packages depend on `auth/` and `common/`.

## Testing

- Table-driven tests.
- Real `youtube.Service` with `httptest.NewServer`.
- Global state (envs) carefully managed/restored.
- See [docs/HOW_TO_TEST.md](../docs/HOW_TO_TEST.md) for details.

## Packages

| Package | Description |
|---------|-------------|
| `auth/` | Authentication service |
| `common/` | Shared types |
| `utils/` | Generic helpers |

### Resource Packages

Each maps 1:1 to a YouTube API resource:

`activity/`, `caption/`, `channel/`, `channelBanner/`, `channelSection/`, `comment/`, `commentThread/`, `i18nLanguage/`, `i18nRegion/`, `member/`, `membershipsLevel/`, `playlist/`, `playlistImage/`, `playlistItem/`, `search/`, `subscription/`, `superChatEvent/`, `thumbnail/`, `video/`, `videoAbuseReportReason/`, `videoCategory/`, `watermark/`
