Help us shape the future of Go! Take the 2026 Go Developer Survey

page

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 7 Imported by: 0

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

type CreateCommand struct {
	Title   string
	Content string
	Area    string
	Tags    []string
}

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

type CreateResult struct {
	Page *pages.Page
}

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.

func (*GetHandler) Handle

func (handler *GetHandler) Handle(ctx context.Context, query GetQuery) (GetResult, error)

Handle rejects invalid UUIDs and mismatched repository responses before returning a page.

type GetQuery

type GetQuery struct {
	ID string
}

GetQuery identifies a page by its stable UUID.

type GetResult

type GetResult struct {
	Page *pages.Page
}

GetResult contains the page returned after a successful get operation.

type UpdateCommand

type UpdateCommand struct {
	ID      string
	Title   string
	Content string
	Area    string
	Tags    []string
}

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

type UpdateResult struct {
	Page *pages.Page
}

UpdateResult contains the page returned after a successful update operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL