How weedbox/postflow works
Project type and purpose
• This is an open‑source Go library (package “postflow”) that provides a complete backend solution for post CRUD, feed generation, reactions, comments, media attachments, filtering, and storage. It is not a full application but a reusable toolkit your clients import and wire into their servers.
File structure
• All code lives at the top level:
• postflow.go: core type definitions (Post, Media, Reaction enum, errors)
• poststore.go / poststore_test.go: PostStore interface + in‑memory implementation
• gorm_poststore.go / gorm_poststore_test.go: GORM‑backed PostStore
• postmanager.go / postmanager_test.go: PostManager that orchestrates CRUD, feeds, filters, reactions
• Tests alongside each implementation reinforce the public API surfaces.
• go.mod/go.sum declare dependencies (GORM, uuid, context).
README for additional insights
• Clarifies dual‑mode storage (in‑memory vs database via GORM).
• Demonstrates how client code instantiates NewInMemoryPostStore or NewGormPostStore and then NewPostManager, then CRUD, reactions, feeds.
• Highlights filtering, pagination, trending, and error types.