Documentation
¶
Overview ¶
Package page manages titled documents with optional hierarchical areas.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCommand ¶
CreateCommand requires a title; content, area and tags are optional raw inputs.
type CreateHandler ¶
type CreateHandler struct {
// contains filtered or unexported fields
}
CreateHandler validates input, assigns identity and lifecycle metadata, and saves a page.
func NewCreateHandler ¶
func NewCreateHandler(repository ports.PageRepository, ids ports.IDGenerator) *CreateHandler
NewCreateHandler creates the use-case handler with its dependencies.
func (*CreateHandler) Handle ¶
func (handler *CreateHandler) Handle(ctx context.Context, command CreateCommand) (CreateResult, error)
Handle validates raw input before persisting a new page and its index projection.
type CreateResult ¶
CreateResult contains the page returned after a successful create operation.
type GetHandler ¶
type GetHandler struct {
// contains filtered or unexported fields
}
GetHandler loads a page from its source document and verifies the requested identity.
func NewGetHandler ¶
func NewGetHandler(repository ports.PageRepository) *GetHandler
NewGetHandler creates the use-case handler with its dependencies.
type UpdateCommand ¶
UpdateCommand requires a title; content, area and tags are optional raw inputs.
type UpdateHandler ¶
type UpdateHandler struct {
// contains filtered or unexported fields
}
UpdateHandler validates replacement values and retains the page's identity and creation time.
func NewUpdateHandler ¶
func NewUpdateHandler(repository ports.PageRepository) *UpdateHandler
NewUpdateHandler creates the use-case handler with its dependencies.
func (*UpdateHandler) Handle ¶
func (handler *UpdateHandler) Handle(ctx context.Context, command UpdateCommand) (UpdateResult, error)
Handle loads the existing page, validates its replacement and persists the updated entity.
type UpdateResult ¶
UpdateResult contains the page returned after a successful update operation.