Documentation
¶
Index ¶
- Constants
- type Intermediate
- type Mock
- func (svc *Mock) Assets(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) ContinueFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) Dashboard(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) FlowDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) ForkFromStep(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) ListFlows(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) ListWorkflows(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) MockAssets(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockContinueFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockDashboard(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockFlowDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockForkFromStep(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockListFlows(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockListWorkflows(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockPollFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockResumeFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockRunWorkflow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockStepDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockTaskDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockWorkflowDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) PollFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) ResumeFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) RunWorkflow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) StepDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) TaskDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) WorkflowDetail(w http.ResponseWriter, r *http.Request) (err error)
- type Service
- func (svc *Service) Assets(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) ContinueFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) Dashboard(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) FlowDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) ForkFromStep(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) Init(initializer func(svc *Service) (err error)) *Service
- func (svc *Service) ListFlows(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) ListWorkflows(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) OnShutdown(ctx context.Context) (err error)
- func (svc *Service) OnStartup(ctx context.Context) (err error)
- func (svc *Service) PollFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) ResumeFlow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) RunWorkflow(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) StepDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) TaskDetail(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) WorkflowDetail(w http.ResponseWriter, r *http.Request) (err error)
- type ToDo
Constants ¶
const ( Hostname = agentstudioapi.Hostname Version = agentstudioapi.Version Description = agentstudioapi.Description )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶
Intermediate extends and customizes the generic base connector.
func NewIntermediate ¶
func NewIntermediate(impl ToDo) *Intermediate
NewIntermediate creates a new instance of the intermediate.
type Mock ¶
type Mock struct {
*Intermediate
// contains filtered or unexported fields
}
Mock is a mockable version of the microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) ContinueFlow ¶
ContinueFlow executes the mock handler.
func (*Mock) FlowDetail ¶
FlowDetail executes the mock handler.
func (*Mock) ForkFromStep ¶ added in v1.43.0
ForkFromStep executes the mock handler.
func (*Mock) ListWorkflows ¶
ListWorkflows executes the mock handler.
func (*Mock) MockAssets ¶
MockAssets sets up a mock handler for Assets.
func (*Mock) MockContinueFlow ¶
func (svc *Mock) MockContinueFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockContinueFlow sets up a mock handler for ContinueFlow.
func (*Mock) MockDashboard ¶
func (svc *Mock) MockDashboard(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockDashboard sets up a mock handler for Dashboard.
func (*Mock) MockFlowDetail ¶
func (svc *Mock) MockFlowDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockFlowDetail sets up a mock handler for FlowDetail.
func (*Mock) MockForkFromStep ¶ added in v1.43.0
func (svc *Mock) MockForkFromStep(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockForkFromStep sets up a mock handler for ForkFromStep.
func (*Mock) MockListFlows ¶
func (svc *Mock) MockListFlows(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockListFlows sets up a mock handler for ListFlows.
func (*Mock) MockListWorkflows ¶
func (svc *Mock) MockListWorkflows(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockListWorkflows sets up a mock handler for ListWorkflows.
func (*Mock) MockPollFlow ¶
func (svc *Mock) MockPollFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockPollFlow sets up a mock handler for PollFlow.
func (*Mock) MockResumeFlow ¶
func (svc *Mock) MockResumeFlow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockResumeFlow sets up a mock handler for ResumeFlow.
func (*Mock) MockRunWorkflow ¶
func (svc *Mock) MockRunWorkflow(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockRunWorkflow sets up a mock handler for RunWorkflow.
func (*Mock) MockStepDetail ¶
func (svc *Mock) MockStepDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockStepDetail sets up a mock handler for StepDetail.
func (*Mock) MockTaskDetail ¶
func (svc *Mock) MockTaskDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockTaskDetail sets up a mock handler for TaskDetail.
func (*Mock) MockWorkflowDetail ¶
func (svc *Mock) MockWorkflowDetail(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockWorkflowDetail sets up a mock handler for WorkflowDetail.
func (*Mock) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Mock) ResumeFlow ¶
ResumeFlow executes the mock handler.
func (*Mock) RunWorkflow ¶
RunWorkflow executes the mock handler.
func (*Mock) StepDetail ¶
StepDetail executes the mock handler.
func (*Mock) TaskDetail ¶
TaskDetail executes the mock handler.
func (*Mock) WorkflowDetail ¶
WorkflowDetail executes the mock handler.
type Service ¶
type Service struct {
*Intermediate // IMPORTANT: Do not remove
// contains filtered or unexported fields
}
Service implements agentstudio.dev which serves a developer UI for inspecting flows.
func (*Service) ContinueFlow ¶
ContinueFlow renders a form to continue a completed flow's thread with additional state, calls foreman.Continue, and redirects the parent page to the new running flow's detail page. Any flowKey in the target thread is accepted; foreman.Continue resolves the thread from the latest completed flow.
func (*Service) Dashboard ¶
Dashboard renders an HTML page with operator dashboards for flows and workflows.
func (*Service) FlowDetail ¶
FlowDetail renders an HTML page with the details, DAG diagram, and step log of a flow.
func (*Service) ForkFromStep ¶ added in v1.43.0
ForkFromStep renders a form to fork a terminal flow from a specific recorded step with optional state overrides, calls foreman.Fork, and redirects the parent page to the newly forked flow's detail page. The original flow is never modified.
func (*Service) ListWorkflows ¶
ListWorkflows renders an HTML page listing every workflow endpoint discoverable on the bus. Multicasts to //all:888/openapi.json and filters operations down to those with x-feature-type=workflow. Bypasses the openapi portal because the portal port-filters and we want every port (workflows live on :428, not :443).
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Service) PollFlow ¶
PollFlow long-polls a flow's graph state. Returns JSON for the bespa ProgressWidget: value=-1 keeps the indeterminate animation, action=URL drives a partial page redraw, stop=true halts the browser polling loop.
func (*Service) ResumeFlow ¶
ResumeFlow renders a form to resume an interrupted flow with a resume payload, calls foreman.Resume, and redirects the parent page back to the same flow's detail page. The payload is delivered to the parked task's flow.Interrupt call as its return value (not merged into state).
func (*Service) RunWorkflow ¶
RunWorkflow renders a form to create and start a workflow with an initial state, and submits it to the foreman. On success it redirects the parent page to the new flow's detail page. State is parsed as JSON first; on failure, retried as YAML so the caller can paste either format without a manual switch.
func (*Service) StepDetail ¶
StepDetail renders an HTML page with the details of one execution step. Designed to be embedded inside the FlowDetail page's modal. Reads the step's full state, changes, and interrupt payload from foreman.Step and lays them out as a form with one field per state key; fields whose values changed during this step show the initial and changed value side-by-side.
func (*Service) TaskDetail ¶
TaskDetail renders an HTML page with the metadata of a single task in a workflow graph. Designed to be embedded inside the WorkflowDetail page's side panel. Reads workflow=<workflowURL>&task=<taskName> from the query, fetches the workflow graph to resolve the task's URL and detect subgraphs, then pulls the task's description from the hosting microservice's :888/openapi.json.
func (*Service) WorkflowDetail ¶
WorkflowDetail renders an HTML page with the structure and definition of a single workflow graph. The workflow is identified by its full bus URL minus the https:// scheme, captured as the greedy {workflowURL...} path argument. The handler fetches the graph from the workflow endpoint and renders it via the workflow package's GraphRenderer.
type ToDo ¶
type ToDo interface {
OnStartup(ctx context.Context) (err error)
OnShutdown(ctx context.Context) (err error)
ListFlows(w http.ResponseWriter, r *http.Request) (err error) // MARKER: ListFlows
FlowDetail(w http.ResponseWriter, r *http.Request) (err error) // MARKER: FlowDetail
StepDetail(w http.ResponseWriter, r *http.Request) (err error) // MARKER: StepDetail
ListWorkflows(w http.ResponseWriter, r *http.Request) (err error) // MARKER: ListWorkflows
WorkflowDetail(w http.ResponseWriter, r *http.Request) (err error) // MARKER: WorkflowDetail
RunWorkflow(w http.ResponseWriter, r *http.Request) (err error) // MARKER: RunWorkflow
ContinueFlow(w http.ResponseWriter, r *http.Request) (err error) // MARKER: ContinueFlow
ResumeFlow(w http.ResponseWriter, r *http.Request) (err error) // MARKER: ResumeFlow
ForkFromStep(w http.ResponseWriter, r *http.Request) (err error) // MARKER: ForkFromStep
PollFlow(w http.ResponseWriter, r *http.Request) (err error) // MARKER: PollFlow
TaskDetail(w http.ResponseWriter, r *http.Request) (err error) // MARKER: TaskDetail
Dashboard(w http.ResponseWriter, r *http.Request) (err error) // MARKER: Dashboard
Assets(w http.ResponseWriter, r *http.Request) (err error) // MARKER: Assets
}
ToDo is implemented by the service or mock. The intermediate delegates handling to this interface.