Documentation
¶
Overview ¶
Package http provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func NewHandler(engine Engine) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ActionRequest
- type ChiServerOptions
- type Engine
- type InvalidParamFormatError
- type MiddlewareFunc
- type NavigateJSONRequestBody
- type NavigateRequest
- type NavigateRequestInput0
- type NavigateRequest_Input
- func (t NavigateRequest_Input) AsNavigateRequestInput0() (NavigateRequestInput0, error)
- func (t NavigateRequest_Input) AsToolResult() (ToolResult, error)
- func (t *NavigateRequest_Input) FromNavigateRequestInput0(v NavigateRequestInput0) error
- func (t *NavigateRequest_Input) FromToolResult(v ToolResult) error
- func (t NavigateRequest_Input) MarshalJSON() ([]byte, error)
- func (t *NavigateRequest_Input) MergeNavigateRequestInput0(v NavigateRequestInput0) error
- func (t *NavigateRequest_Input) MergeToolResult(v ToolResult) error
- func (t *NavigateRequest_Input) UnmarshalJSON(b []byte) error
- type RenderJSONRequestBody
- type RenderResponse
- type RequiredHeaderError
- type RequiredParamError
- type Server
- func (s *Server) GetGraph(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetInfo(w http.ResponseWriter, r *http.Request)
- func (s *Server) Navigate(w http.ResponseWriter, r *http.Request)
- func (s *Server) Render(w http.ResponseWriter, r *http.Request)
- func (s *Server) Signal(w http.ResponseWriter, r *http.Request)
- func (s *Server) SubscribeEvents(w http.ResponseWriter, r *http.Request, params SubscribeEventsParams)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetGraph(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Navigate(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Render(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Signal(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SubscribeEvents(w http.ResponseWriter, r *http.Request)
- type SignalJSONBody
- type SignalJSONRequestBody
- type State
- type StreamManager
- type SubscribeEventsParams
- type TooManyValuesForParamError
- type ToolResult
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GetGraph(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) Navigate(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) Render(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) Signal(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) SubscribeEvents(w http.ResponseWriter, r *http.Request, params SubscribeEventsParams)
- type UnmarshalingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewHandler ¶
NewHandler creates a new HTTP handler for the engine.
Types ¶
type ActionRequest ¶
type ActionRequest struct {
// Payload Dynamic payload depending on the action type.
Payload interface{} `json:"payload"`
// Type The type of action (e.g., RENDER_CONTENT, REQUEST_INPUT).
Type string `json:"type"`
}
ActionRequest defines model for ActionRequest.
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type NavigateJSONRequestBody ¶
type NavigateJSONRequestBody = NavigateRequest
NavigateJSONRequestBody defines body for Navigate for application/json ContentType.
type NavigateRequest ¶
type NavigateRequest struct {
// Input The user input or tool result.
}
NavigateRequest defines model for NavigateRequest.
type NavigateRequestInput0 ¶
type NavigateRequestInput0 = string
NavigateRequestInput0 defines model for .
type NavigateRequest_Input ¶
type NavigateRequest_Input struct {
// contains filtered or unexported fields
}
NavigateRequest_Input The user input or tool result.
func (NavigateRequest_Input) AsNavigateRequestInput0 ¶
func (t NavigateRequest_Input) AsNavigateRequestInput0() (NavigateRequestInput0, error)
AsNavigateRequestInput0 returns the union data inside the NavigateRequest_Input as a NavigateRequestInput0
func (NavigateRequest_Input) AsToolResult ¶
func (t NavigateRequest_Input) AsToolResult() (ToolResult, error)
AsToolResult returns the union data inside the NavigateRequest_Input as a ToolResult
func (*NavigateRequest_Input) FromNavigateRequestInput0 ¶
func (t *NavigateRequest_Input) FromNavigateRequestInput0(v NavigateRequestInput0) error
FromNavigateRequestInput0 overwrites any union data inside the NavigateRequest_Input as the provided NavigateRequestInput0
func (*NavigateRequest_Input) FromToolResult ¶
func (t *NavigateRequest_Input) FromToolResult(v ToolResult) error
FromToolResult overwrites any union data inside the NavigateRequest_Input as the provided ToolResult
func (NavigateRequest_Input) MarshalJSON ¶
func (t NavigateRequest_Input) MarshalJSON() ([]byte, error)
func (*NavigateRequest_Input) MergeNavigateRequestInput0 ¶
func (t *NavigateRequest_Input) MergeNavigateRequestInput0(v NavigateRequestInput0) error
MergeNavigateRequestInput0 performs a merge with any union data inside the NavigateRequest_Input, using the provided NavigateRequestInput0
func (*NavigateRequest_Input) MergeToolResult ¶
func (t *NavigateRequest_Input) MergeToolResult(v ToolResult) error
MergeToolResult performs a merge with any union data inside the NavigateRequest_Input, using the provided ToolResult
func (*NavigateRequest_Input) UnmarshalJSON ¶
func (t *NavigateRequest_Input) UnmarshalJSON(b []byte) error
type RenderJSONRequestBody ¶
type RenderJSONRequestBody = State
RenderJSONRequestBody defines body for Render for application/json ContentType.
type RenderResponse ¶
type RenderResponse struct {
Actions *[]ActionRequest `json:"actions,omitempty"`
State *State `json:"state,omitempty"`
// Terminal True if the current node has no outgoing transitions.
Terminal *bool `json:"terminal,omitempty"`
}
RenderResponse defines model for RenderResponse.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type Server ¶
type Server struct {
Engine Engine
Streams *StreamManager
}
Server implements the generated ServerInterface
func (*Server) GetGraph ¶
func (s *Server) GetGraph(w http.ResponseWriter, r *http.Request)
GetGraph handles the GET /graph request.
func (*Server) GetHealth ¶
func (s *Server) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth handles the GET /health request.
func (*Server) GetInfo ¶
func (s *Server) GetInfo(w http.ResponseWriter, r *http.Request)
GetInfo handles the GET /info request.
func (*Server) Navigate ¶
func (s *Server) Navigate(w http.ResponseWriter, r *http.Request)
Navigate handles the POST /navigate request.
func (*Server) Render ¶
func (s *Server) Render(w http.ResponseWriter, r *http.Request)
Render handles the POST /render request.
func (*Server) Signal ¶
func (s *Server) Signal(w http.ResponseWriter, r *http.Request)
Signal handles the POST /signal request.
func (*Server) SubscribeEvents ¶
func (s *Server) SubscribeEvents(w http.ResponseWriter, r *http.Request, params SubscribeEventsParams)
SubscribeEvents handles the GET /events request (SSE).
type ServerInterface ¶
type ServerInterface interface {
// Subscribe to server-sent events for graph changes
// (GET /events)
SubscribeEvents(w http.ResponseWriter, r *http.Request, params SubscribeEventsParams)
// Introspect the full state machine graph
// (GET /graph)
GetGraph(w http.ResponseWriter, r *http.Request)
// Liveness probe
// (GET /health)
GetHealth(w http.ResponseWriter, r *http.Request)
// Server metadata and version information
// (GET /info)
GetInfo(w http.ResponseWriter, r *http.Request)
// (POST /navigate)
Navigate(w http.ResponseWriter, r *http.Request)
// Get the current view (actions) for a given state
// (POST /render)
Render(w http.ResponseWriter, r *http.Request)
// Send a global signal to the state machine
// (POST /signal)
Signal(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetGraph ¶
func (siw *ServerInterfaceWrapper) GetGraph(w http.ResponseWriter, r *http.Request)
GetGraph operation middleware
func (*ServerInterfaceWrapper) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetInfo ¶
func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request)
GetInfo operation middleware
func (*ServerInterfaceWrapper) Navigate ¶
func (siw *ServerInterfaceWrapper) Navigate(w http.ResponseWriter, r *http.Request)
Navigate operation middleware
func (*ServerInterfaceWrapper) Render ¶
func (siw *ServerInterfaceWrapper) Render(w http.ResponseWriter, r *http.Request)
Render operation middleware
func (*ServerInterfaceWrapper) Signal ¶
func (siw *ServerInterfaceWrapper) Signal(w http.ResponseWriter, r *http.Request)
Signal operation middleware
func (*ServerInterfaceWrapper) SubscribeEvents ¶
func (siw *ServerInterfaceWrapper) SubscribeEvents(w http.ResponseWriter, r *http.Request)
SubscribeEvents operation middleware
type SignalJSONBody ¶
type SignalJSONBody struct {
// Signal The name of the signal (e.g., "interrupt", "timeout")
Signal string `json:"signal"`
State State `json:"state"`
}
SignalJSONBody defines parameters for Signal.
type SignalJSONRequestBody ¶
type SignalJSONRequestBody SignalJSONBody
SignalJSONRequestBody defines body for Signal for application/json ContentType.
type State ¶
type State struct {
// Actions List of actions to be performed (e.g., render content).
Actions *[]ActionRequest `json:"actions,omitempty"`
// CurrentNodeId The identifier of the active node.
CurrentNodeId string `json:"current_node_id"`
// History Trace of visited nodes.
History *[]string `json:"history,omitempty"`
// Locale Preferred language for the session.
Locale *string `json:"locale,omitempty"`
// Memory Key-value store for session variables.
Memory *map[string]interface{} `json:"memory,omitempty"`
// PendingToolCall ID of a tool call being waited on.
PendingToolCall *string `json:"pending_tool_call,omitempty"`
SessionId *string `json:"session_id,omitempty"`
// Status Current lifecycle status of the State.
Status *string `json:"status,omitempty"`
// Terminated Indicates if the execution has reached a sink state.
Terminated *bool `json:"terminated,omitempty"`
}
State defines model for State.
type StreamManager ¶ added in v0.7.9
type StreamManager struct {
// contains filtered or unexported fields
}
StreamManager handles active SSE connections
func NewStreamManager ¶ added in v0.7.9
func NewStreamManager() *StreamManager
func (*StreamManager) Broadcast ¶ added in v0.7.9
func (sm *StreamManager) Broadcast(sessionID string, msg string)
func (*StreamManager) Subscribe ¶ added in v0.7.9
func (sm *StreamManager) Subscribe(sessionID string) (chan string, func())
type SubscribeEventsParams ¶ added in v0.7.9
type SubscribeEventsParams struct {
// SessionId Session ID to subscribe to for state updates
SessionId *string `form:"session_id,omitempty" json:"session_id,omitempty"`
// Watch Comma-separated list of fields to watch (e.g. "context,history")
Watch *string `form:"watch,omitempty" json:"watch,omitempty"`
}
SubscribeEventsParams defines parameters for SubscribeEvents.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type ToolResult ¶
type ToolResult struct {
Error *string `json:"error,omitempty"`
// Id Corresponds to the ToolCall ID.
Id string `json:"id"`
IsError *bool `json:"is_error,omitempty"`
// Result The output of the tool execution.
Result interface{} `json:"result"`
}
ToolResult defines model for ToolResult.
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GetGraph ¶
func (_ Unimplemented) GetGraph(w http.ResponseWriter, r *http.Request)
Introspect the full state machine graph (GET /graph)
func (Unimplemented) GetHealth ¶
func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)
Liveness probe (GET /health)
func (Unimplemented) GetInfo ¶
func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request)
Server metadata and version information (GET /info)
func (Unimplemented) Navigate ¶
func (_ Unimplemented) Navigate(w http.ResponseWriter, r *http.Request)
Transition to the next state based on input (POST /navigate)
func (Unimplemented) Render ¶
func (_ Unimplemented) Render(w http.ResponseWriter, r *http.Request)
Get the current view (actions) for a given state (POST /render)
func (Unimplemented) Signal ¶
func (_ Unimplemented) Signal(w http.ResponseWriter, r *http.Request)
Send a global signal to the state machine (POST /signal)
func (Unimplemented) SubscribeEvents ¶
func (_ Unimplemented) SubscribeEvents(w http.ResponseWriter, r *http.Request, params SubscribeEventsParams)
Subscribe to server-sent events for graph changes (GET /events)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error