requests

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package requests is a domain-neutral private fixture module used by the wowapi module-contract test suite (blueprint 08 §2, 11 §4). A "request" has a title and a lifecycle status — no housing-society or product-domain terms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SLAHours int `json:"sla_hours"`
}

Config is the module's typed configuration namespace (modules.requests.*).

type CreateRequest

type CreateRequest struct {
	Title string `json:"title" validate:"required"`
}

CreateRequest is the wire DTO decoded from POST /requests.

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

Handlers holds injected collaborators for every route in this module.

Route-level authorization (the RouteMeta permission) is now enforced by the framework's httpx.SecureHandler gate BEFORE a handler runs (AuthN → bind tenant/actor → AuthZ(permission)), so these handlers already run only for an authorized actor. The stored evaluator is for FINE-GRAINED, resource-scoped checks a handler makes against a concrete target (e.g. "read THIS request"); this neutral fixture module has none, so it is unused here.

func (*Handlers) Create

func (h *Handlers) Create(w http.ResponseWriter, r *http.Request)

Create handles POST /requests.

func (*Handlers) Healthz

func (h *Handlers) Healthz(w http.ResponseWriter, r *http.Request)

Healthz handles GET /requests/healthz (public, no auth required).

func (*Handlers) List

func (h *Handlers) List(w http.ResponseWriter, r *http.Request)

List handles GET /requests.

func (*Handlers) Read

func (h *Handlers) Read(w http.ResponseWriter, r *http.Request)

Read handles GET /requests/{id}.

type Lookup

type Lookup interface {
	ByID(ctx context.Context, id uuid.UUID) (*RequestDTO, error)
}

Lookup is the inter-module port other modules consume via mc.Port("requests.Lookup"). Exercises the ProvidePort/Port wiring path.

type Module

type Module struct{}

Module is the "requests" domain-neutral fixture module. It satisfies module.Module and serves as the canonical neutral example for the wowapi module-contract suite (blueprint 08 §2, 11 §4).

func (*Module) DependsOn

func (m *Module) DependsOn() []string

DependsOn declares no dependencies: requests is a leaf fixture module.

func (*Module) Name

func (m *Module) Name() string

Name returns the module identifier. All seeds, permissions, and resource types are prefixed "requests.".

func (*Module) Register

func (m *Module) Register(mc module.Context) error

Register wires the module into the framework. It only wires — no I/O.

type RequestDTO

type RequestDTO struct {
	ID     uuid.UUID `json:"id"`
	Title  string    `json:"title"`
	Status string    `json:"status"`
}

RequestDTO is the success-response representation of a request aggregate. Domain types never serialize directly — this DTO is the only wire shape.

Jump to

Keyboard shortcuts

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