Documentation
¶
Overview ¶
Package api provides the REST API server for the agent-factory. It exposes endpoints for submitting work, querying token state, and listing workflow records.
Index ¶
- func BuildFactoryWorldWorkstationRequestProjectionSlice(state interfaces.FactoryWorldState) factoryapi.FactoryWorldWorkstationRequestProjectionSlice
- type Server
- func (s *Server) CreateFactory(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetCurrentFactory(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetEvents(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetWork(w http.ResponseWriter, r *http.Request, id factoryapi.WorkOrTokenID)
- func (s *Server) Handler() http.Handler
- func (s *Server) ListWork(w http.ResponseWriter, r *http.Request, params factoryapi.ListWorkParams)
- func (s *Server) ListenAndServe(ctx context.Context) error
- func (s *Server) Serve(ctx context.Context, listener net.Listener) error
- func (s *Server) SubmitWork(w http.ResponseWriter, r *http.Request)
- func (s *Server) UpsertWorkRequest(w http.ResponseWriter, r *http.Request, requestID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFactoryWorldWorkstationRequestProjectionSlice ¶
func BuildFactoryWorldWorkstationRequestProjectionSlice( state interfaces.FactoryWorldState, ) factoryapi.FactoryWorldWorkstationRequestProjectionSlice
BuildFactoryWorldWorkstationRequestProjectionSlice keeps the additive workstation-request contract at the API boundary while deriving it from the canonical selected-tick FactoryWorldState model.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the REST API server for the agent-factory.
func NewServer ¶
func NewServer(runtime apisurface.APISurface, port int, logger *zap.Logger) *Server
NewServer creates a new API server.
func (*Server) CreateFactory ¶
func (s *Server) CreateFactory(w http.ResponseWriter, r *http.Request)
func (*Server) GetCurrentFactory ¶
func (s *Server) GetCurrentFactory(w http.ResponseWriter, r *http.Request)
func (*Server) GetEvents ¶
func (s *Server) GetEvents(w http.ResponseWriter, r *http.Request)
GetEvents handles GET /events as a canonical factory event SSE stream.
func (*Server) GetStatus ¶
func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request)
GetStatus handles GET /status as the supported runtime status read model.
func (*Server) GetWork ¶
func (s *Server) GetWork(w http.ResponseWriter, r *http.Request, id factoryapi.WorkOrTokenID)
func (*Server) ListWork ¶
func (s *Server) ListWork(w http.ResponseWriter, r *http.Request, params factoryapi.ListWorkParams)
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server. Blocks until ctx is cancelled.
func (*Server) Serve ¶
Serve starts the HTTP server on an already-bound listener. Blocks until ctx is cancelled or the server fails.
func (*Server) SubmitWork ¶
func (s *Server) SubmitWork(w http.ResponseWriter, r *http.Request)