server

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustLoadTLS

func MustLoadTLS(c *conf.TLSConfig) *tls.Config

MustLoadTLS 从配置加载 TLS 证书。 如果加载失败会 panic,因为 TLS 配置错误是严重的启动时错误。

Types

type EndpointProvider

type EndpointProvider interface {
	Endpoint() (*url.URL, error)
}

EndpointProvider 定义服务注册地址契约。

type Lifecycle

type Lifecycle interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Lifecycle 定义服务启停契约。

type PluginKind

type PluginKind string

PluginKind 定义可插拔服务器类型。

const (
	PluginWebSocket PluginKind = "websocket"
	PluginMCP       PluginKind = "mcp"
	PluginGraphQL   PluginKind = "graphql"
)

type Server

type Server interface {
	Lifecycle
	EndpointProvider
}

Server 聚合 transport 扩展服务的最小能力集合。

type ServerPlugin

type ServerPlugin interface {
	Server
	Kind() PluginKind
}

ServerPlugin 定义可插拔服务器接口,用于扩展 WebSocket/MCP/GraphQL 等协议。

Directories

Path Synopsis
Package middleware 提供服务器中间件链构建工具。
Package middleware 提供服务器中间件链构建工具。

Jump to

Keyboard shortcuts

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