Help us shape the future of Go! Take the 2026 Go Developer Survey

runtimeapi

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowHeader

func AllowHeader(path string) string

func Dispatch

func Dispatch(ctx context.Context, runtime Runtime, request Request) (map[string]any, error)

Dispatch 只负责 Runtime API 的路由、参数校验与应用能力调用,不感知 HTTP request/response。

func MethodAllowed

func MethodAllowed(method, path string) bool

MethodAllowed 返回指定 Runtime API 路径允许当前方法与否。 HTTP 入口用它生成 405,其他传输也复用同一份方法契约。

Types

type Request

type Request struct {
	Method string          `json:"method"`
	Path   string          `json:"path"`
	Query  url.Values      `json:"query,omitempty"`
	Body   json.RawMessage `json:"body,omitempty"`
}

Request 是 HTTP 与 Nexus Bridge 共用的 Runtime API 请求表示。

type Runtime

type Runtime interface {
	RuntimeStatus() app.Result
	RuntimeSkills() (app.Result, error)
	RuntimeSkill(skill string) (app.Result, error)
	RuntimeSkillFiles(skill string) (app.Result, error)
	RuntimeSkillFile(skill, path string) (app.Result, error)
	RuntimeTasks(status string, limit int) (app.Result, error)
	RuntimeTask(id string) (app.Result, error)
	RuntimeTaskDelete(id string) (app.Result, error)
	RuntimeCapabilities(context.Context, bool) (app.Result, error)
	RuntimeMCPServers(context.Context) (app.Result, error)
	RuntimeMCPServer(context.Context, string) (app.Result, error)
	RuntimeMCPManage(context.Context, map[string]any) (app.Result, error)
	RuntimeEvolve(context.Context, map[string]any) (app.Result, error)
}

Runtime 定义 Runtime API 路由真正需要的应用能力。 HTTP、Nexus Bridge 等传输层都只依赖这份传输无关契约。

Jump to

Keyboard shortcuts

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