imagegen

package
v1.261203.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

This section is empty.

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 NewHandler

func NewHandler() *Handler

NewHandler creates a Handler.

func (*Handler) GetInfo

func (h *Handler) GetInfo(c *gin.Context)

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.

func (*Handler) RegisterRoutes added in v1.261002.1

func (h *Handler) RegisterRoutes(rt *module.Routes)

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.

Jump to

Keyboard shortcuts

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