Documentation
¶
Overview ¶
Package attachment exposes the CLI-shaped facade for managing entity file attachments (attach, list). The service depends only on the focused primitives it needs (Store, Meta, EntityManager) so it can be constructed at any wiring site.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Store store.Store
Meta *metamodel.Metamodel
EntityManager entitymanager.EntityManager
}
Deps is the dependency bundle New requires. Every field is mandatory; New returns an error if any is nil.
type Result ¶
Result is the outcome of Service.Attach.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the attachment-facade methods that CLI invokes. Constructed once at the wiring site and shared across subcommands.
func New ¶
New constructs a Service. Returns an error if any required dependency is nil — CLAUDE.md "constructors reject nil required fields."
func (*Service) Attach ¶
Attach streams the file at filePath into the store at `attachments/<entityID>/<property>/<base(filePath)>` and records the path on the entity's property. The stored file overwrites any existing attachment at the same path — file-type properties hold at most one attachment.
If property is empty, the first file-type property declared on the entity type (in alphabetical order — see [findFileProperty]) is used.