Documentation
¶
Overview ¶
Package web provides the HTTP server and web UI for wherehouse.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface {
ListEntities(ctx context.Context) ([]app.EntityResult, error)
GetEntityByID(ctx context.Context, entityID string) (app.EntityResult, error)
GetChildren(ctx context.Context, parentID string) ([]app.EntityResult, error)
GetHistory(ctx context.Context, req app.GetHistoryRequest) ([]app.HistoryResult, error)
CreateEntity(ctx context.Context, req app.CreateEntityRequest) (app.EntityResult, error)
RenameEntity(ctx context.Context, req app.RenameEntityRequest) (app.EntityResult, error)
ChangeStatus(ctx context.Context, req app.ChangeStatusRequest) error
FindEntities(ctx context.Context, req app.FindEntitiesRequest) ([]app.FindResult, error)
}
App is the dependency contract the web package requires from the app layer.
type Breadcrumb ¶ added in v0.3.0
Breadcrumb is one segment of the entity path shown above the detail heading. EntityID is empty for the last (current) crumb — it renders as plain text.
func BreadcrumbsForEntity ¶ added in v0.3.0
func BreadcrumbsForEntity(entities []app.EntityResult, fullPath string) []Breadcrumb
BreadcrumbsForEntity builds a breadcrumb slice from fullPath by matching each path prefix against the provided entity list. Exported for testing.
type Config ¶
type Config struct {
App App
Bind string
Port int
Output io.Writer // destination for the startup URL line; defaults to os.Stdout
Logger logging.Logger // structured logger; defaults to logging.GetLogger()
}
Config holds all configuration for the web server.
Click to show internal directories.
Click to hide internal directories.