Documentation
¶
Index ¶
- func ApplyParsedFlags(cfg *config.Config, cmd *cli.Command, state *FlagState, validateListeners bool) error
- func Command() *cli.Command
- func EmbeddedFlags(cfg *config.Config, state *FlagState) []cli.Flag
- func Flags(cfg *config.Config, state *FlagState) []cli.Flag
- func GetTokenResolver(s *Server) *security.TokenResolver
- type FlagState
- type PreparedListener
- type RunningServers
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyParsedFlags ¶
func GetTokenResolver ¶ added in v0.0.3
func GetTokenResolver(s *Server) *security.TokenResolver
GetTokenResolver returns the TokenResolver used by this server, or nil if not yet built. Used by embedded MCP to call ConfigureEmbeddedMCP after BuildServer.
Types ¶
type FlagState ¶
type FlagState struct {
ReadHeaderTimeoutSecs int
CacheLocalMaxBytes string
CacheLocalNumCounters int
CacheLocalBufferItems int
}
func NewFlagState ¶
type PreparedListener ¶
type RunningServers ¶
type RunningServers struct {
Addr net.Addr
Port int
Endpoint string
Network string
HTTPServerPlain *http.Server
HTTPServerTLS *http.Server
GRPCServer *grpc.Server
Close func(ctx context.Context) error
}
func StartSinglePortHTTPAndGRPC ¶
func StartSinglePortHTTPAndGRPC( _ context.Context, cfg config.ListenerConfig, httpHandler http.Handler, grpcServer *grpc.Server, ) (*RunningServers, error)
type Server ¶
type Server struct {
Config *config.Config
Store registrystore.MemoryStore
Router *gin.Engine
GRPCServer *grpc.Server
Running *RunningServers
TokenResolver *security.TokenResolver
// contains filtered or unexported fields
}
Server holds the running server and its subsystems.
func BuildServer ¶
BuildServer initializes all subsystems without binding any network listeners.
func StartServer ¶
StartServer initializes all subsystems and starts HTTP+gRPC on a single port. Use cfg.HTTPPort=0 for a random port. Actual port: Server.Running.Port.
func (*Server) Shutdown ¶
Shutdown gracefully shuts down the server. Order: management listener → main listener drain → tracer provider flush. Both listeners are drained before provider shutdown so that spans ending during either drain are exported rather than silently dropped. All three error values are joined and returned together.
Source Files
¶
- cors.go
- listener.go
- listener_tcp.go
- listener_uds.go
- management.go
- path_parameters.go
- plugin_awskms.go
- plugin_eventbus.go
- plugin_infinispan.go
- plugin_mongo.go
- plugin_openai.go
- plugin_postgresql.go
- plugin_qdrant.go
- plugin_redis.go
- plugin_s3.go
- plugin_sqlite.go
- plugin_sqlitevec.go
- plugin_vault.go
- security_headers.go
- serve.go
- server.go
- singleport.go
- validation.go
- wrapper_routes.go