Documentation
¶
Index ¶
- func CreateAPI(db *gorm.DB) fiber.Handler
- func CreateGroup(db *gorm.DB) fiber.Handler
- func DeleteAPI(db *gorm.DB) fiber.Handler
- func DeleteGroup(db *gorm.DB) fiber.Handler
- func DuplicateAPI(db *gorm.DB) fiber.Handler
- func ExportAPIs(db *gorm.DB) fiber.Handler
- func GetAPI(db *gorm.DB) fiber.Handler
- func GetAPIsByGroup(db *gorm.DB) fiber.Handler
- func GetDistPath() (string, error)
- func GetGroups(db *gorm.DB) fiber.Handler
- func GetGroupsWithAPIs(db *gorm.DB) fiber.Handler
- func HandleMCPTools(db *gorm.DB) fiber.Handler
- func ImportDocument(db *gorm.DB) fiber.Handler
- func ListAPIs(db *gorm.DB) fiber.Handler
- func RegisterRoutes(app *fiber.App, db *gorm.DB, prefix string)
- func ServeEmbeddedFiles(embedFS fs.FS) fiber.Handler
- func ServeStaticFiles(distPath string) fiber.Handler
- func SetupRoutes(app *fiber.App, db *gorm.DB)
- func UpdateAPI(db *gorm.DB) fiber.Handler
- func UpdateAPINote(db *gorm.DB) fiber.Handler
- func UpdateAPIOrders(db *gorm.DB) fiber.Handler
- func UpdateGroup(db *gorm.DB) fiber.Handler
- func UpdateGroupOrders(db *gorm.DB) fiber.Handler
- func UpdateParameters(db *gorm.DB) fiber.Handler
- func UpdateParametersFromJSON(db *gorm.DB) fiber.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteGroup ¶
DeleteGroup deletes a group and all its APIs
func DuplicateAPI ¶
DuplicateAPI duplicates an API with all its parameters within the same group
func ExportAPIs ¶
ExportAPIs exports selected APIs in the requested format: "html" (default), "json" (Knot JSON v1), "openapi" or "postman". The document itself is built by services.BuildExportDocument, the shared source also used by the embeddable engine facade, so both surfaces serve byte-identical payloads and filenames.
func GetAPIsByGroup ¶
GetAPIsByGroup returns all APIs in a group
func GetDistPath ¶
GetDistPath returns the path to the frontend dist directory It tries multiple locations in order: 1. ./web/dist (embedded or production location) 2. ./frontend/dist (development mode in same directory) 3. ../frontend/dist (development mode from backend-go directory)
func GetGroupsWithAPIs ¶
GetGroupsWithAPIs returns all groups with their APIs
func HandleMCPTools ¶
HandleMCPTools handles all MCP tool calls
func ImportDocument ¶
ImportDocument handles the upload and import of an API documentation file per spec §8.1. The request must be multipart/form-data with a required "file" field and an optional "dryRun" form value (any truthy spelling accepted by strconv.ParseBool previews the import without writing anything). The format is auto-detected from the file bytes (Knot JSON, Postman Collection v2.0/v2.1, OpenAPI 3.x); the parsed plan is applied transactionally and the resulting counts and warnings are returned.
func ListAPIs ¶ added in v0.1.1
ListAPIs returns a flat, paginated, searchable listing of every API ordered by its parent group's position first (group order, then API order, then id for a stable total ordering).
Supported query parameters:
page default 1, clamped >= 1 (non-numeric -> 400) pageSize default 50, clamped 1..100 (non-numeric -> 400) keyword case-insensitive substring match on name OR endpoint groupId exact group filter (non-numeric -> 400) method exact HTTP method filter, input is upper-cased first
func RegisterRoutes ¶
RegisterRoutes registers all API routes under the given prefix. It is the single routing source shared by SetupRoutes and the embeddable engine facade (knot.Knot.Mount), which mounts the same routes under a host-chosen prefix. It must be exported because the facade lives in the module-root package knot, a different package from this one.
func ServeEmbeddedFiles ¶
ServeEmbeddedFiles serves static files from an embedded filesystem
func ServeStaticFiles ¶
ServeStaticFiles serves static files from the frontend dist directory It supports both development mode (reading from ../frontend/dist) and production mode
func SetupRoutes ¶
SetupRoutes registers all API routes on the given Fiber app under the default "/api" prefix. Both the standalone server and CLI serve command use this to avoid duplication.
func UpdateAPIOrders ¶
UpdateAPIOrders updates the order of multiple APIs
func UpdateGroupOrders ¶
UpdateGroupOrders updates the order of multiple groups
func UpdateParameters ¶
UpdateParameters updates parameters from structure
Types ¶
This section is empty.