Documentation
¶
Overview ¶
Package imagegen exposes control-plane HTTP endpoints for the image generation scenario — separate from the OpenAI-compatible gateway routes under /tingly/imagegen, which only ever see requests/responses, never the local filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(router *swagger.RouteGroup, handler *Handler)
RegisterRoutes registers the imagegen control-plane routes.
Types ¶
type Handler ¶
type Handler struct{}
Handler serves /api/v1/imagegen endpoints. It carries no state: the output directory is derived fresh from constant.GetTinglyConfDir() on every call, the same way internal/protocolserver/openai_image.go's persistImages resolves where it writes generated images.
func (*Handler) GetInfo ¶
GetInfo handles GET /api/v1/imagegen/info: reports read-only facts about the imagegen scenario, currently just the directory generated/edited images are persisted to (~/.tingly-box/image/YYYYMMDD/*.png, see persistImages). Side-effect-free — this server never reaches into the local OS to open a file manager window; the path is handed to the frontend so the user can navigate there themselves, which also works whenever the browser isn't on the same machine as this server.
type ImageGenInfoResponse ¶
type ImageGenInfoResponse struct {
Success bool `json:"success" example:"true"`
// OutputDir is the local path generated/edited images are persisted to.
// Read-only: the frontend shows it so the user can find the folder
// themselves (copy it, paste it into their own file manager) rather than
// the server reaching for a file-manager window on their behalf, which
// would be meaningless whenever the browser and this server aren't the
// same machine.
OutputDir string `json:"output_dir" example:"/home/user/.tingly-box/image"`
}
ImageGenInfoResponse is the JSON envelope for GET /api/v1/imagegen/info. A general info endpoint rather than one named after its first field — OutputDir is the only thing worth reporting today, but future fields (e.g. how many images are saved, or the most recent one) belong here too, without forcing a new endpoint per field. Named with the module's own prefix, not a bare "InfoResponse" — swagger's model registry keys schemas by Go type name, and several other modules already have their own info response shape.