api

package
v0.19.1205 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MCPDefaultListLimit = 20
	MCPMaxListLimit     = 100
)
View Source
const MCPListToolHint = "" /* 204-byte string literal not displayed */

MCPListToolHint is appended to paginated list-tool descriptions so agents surface leftover rows instead of paging until the full set is in context.

View Source
const MCPPoliciesInstructions = "" /* 459-byte string literal not displayed */

MCPPoliciesInstructions is included in MCP server instructions so clients run the local policies CLI extension when editing app IAM, instead of inventing overlap and boundary checks.

View Source
const MCPTimeInstructions = "" /* 202-byte string literal not displayed */

MCPTimeInstructions is included in MCP server instructions so clients treat timestamps as UTC and localize before naming a day or clock time.

Variables

This section is empty.

Functions

func APIGroupParam

func APIGroupParam(f any) any

func AsAPI

func AsAPI(f any) any

func AsNuonctlMCPService added in v0.19.1178

func AsNuonctlMCPService(f any) any

func AsService

func AsService(f any) any

func MCPClipList added in v0.19.1178

func MCPClipList[T any](rows []T, limit int) ([]T, bool)

MCPClipList trims a Limit(limit+1) query down to the page and reports overflow.

func MCPJSONResult added in v0.19.1150

func MCPJSONResult(v any) (*mcp.CallToolResult, any, error)

func MCPListPage added in v0.19.1178

func MCPListPage(limit, offset int) (int, int, error)

MCPListPage clamps a list tool's limit/offset. A zero limit uses MCPDefaultListLimit.

func MCPNextOffset added in v0.19.1178

func MCPNextOffset(offset, limit int, hasMore bool) int

MCPNextOffset is 0 when the page is complete so callers can omit it from JSON.

func MCPReadTool added in v0.19.1159

func MCPReadTool(name, title, description string) *mcp.Tool

MCPReadTool builds a read-only MCP tool with standard annotations.

func MCPTime added in v0.19.1166

func MCPTime(t time.Time) string

MCPTime formats a timestamp for MCP payloads as UTC RFC3339 (Zulu, …Z). Agents localize this instant before naming a calendar day or clock time.

func MCPTimePtr added in v0.19.1166

func MCPTimePtr(t *time.Time) string

func MCPWriteTool added in v0.19.1159

func MCPWriteTool(name, title, description string, destructive, idempotent bool) *mcp.Tool

MCPWriteTool builds a mutating MCP tool. Description should still use the WRITE OPERATION: prefix so the CLI --allow-writes filter can hide it.

Types

type API

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

func NewAdminDashboardAPI

func NewAdminDashboardAPI(params Params) (*API, error)

func NewAuthAPI

func NewAuthAPI(params Params) (*API, error)

func NewInternalAPI

func NewInternalAPI(params Params) (*API, error)

func NewPublicAPI

func NewPublicAPI(params Params) (*API, error)

func NewRunnerAPI

func NewRunnerAPI(params Params) (*API, error)

func NewSlackAPI added in v0.19.927

func NewSlackAPI(params Params) (*API, error)

NewSlackAPI builds the dedicated HTTP listener for Slack-originating traffic: OAuth callback, slash commands, and Slack Events API webhooks.

This is a separate listener (its own port, its own ingress) rather than being mounted on the public API to keep Slack's signing-secret-based auth model isolated from the API-key + org-id model used by /v1/*.

type APIContextType

type APIContextType string
const (
	APIContextTypePublic   APIContextType = "public"
	APIContextTypeRunner   APIContextType = "runner"
	APIContextTypeInternal APIContextType = "internal"
)

func (APIContextType) String

func (a APIContextType) String() string

type EndpointAudit

type EndpointAudit struct {
	// map to hold deprecated endpoints
	// format: method_name_path (e.g., GET_public_/v1/old-endpoint)
	Routes map[string]struct{}
}

func NewEndpointAudit

func NewEndpointAudit() *EndpointAudit

func (*EndpointAudit) Add

func (d *EndpointAudit) Add(method, name, path string)

func (*EndpointAudit) IsDeprecated

func (d *EndpointAudit) IsDeprecated(method, name, path string) bool

type MCPService added in v0.19.1150

type MCPService interface {
	RegisterMCPTools(server *mcp.Server)
}

type Params

type Params struct {
	fx.In

	LC         fx.Lifecycle
	Shutdowner fx.Shutdowner

	Services      []Service                `group:"services"`
	Middlewares   []middlewares.Middleware `group:"middlewares"`
	L             *zap.Logger
	Cfg           *internal.Config
	DB            *gorm.DB `name:"psql"`
	EndpointAudit *EndpointAudit
	HTTPMetrics   *metrics.HTTPMetrics
}

type RouteRegister

type RouteRegister struct {
	EndpointAudit *EndpointAudit
}

func (*RouteRegister) DELETE

func (r *RouteRegister) DELETE(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) GET

func (r *RouteRegister) GET(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) PATCH

func (r *RouteRegister) PATCH(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) POST

func (r *RouteRegister) POST(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) PUT

func (r *RouteRegister) PUT(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

type Service

type Service interface {
	RegisterPublicRoutes(*gin.Engine) error
	RegisterRunnerRoutes(*gin.Engine) error
	RegisterInternalRoutes(*gin.Engine) error
	RegisterAuthRoutes(*gin.Engine) error
	RegisterAdminDashboardRoutes(*gin.Engine) error
	RegisterSlackRoutes(*gin.Engine) error
}

Jump to

Keyboard shortcuts

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