manager

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationQueued     = "queued"
	OperationRunning    = "running"
	OperationSucceeded  = "succeeded"
	OperationFailed     = "failed"
	OperationCancelling = "cancelling"
	OperationCancelled  = "cancelled"
)
View Source
const ServiceID = "manager"

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct {
	URL     string            `json:"url"`
	Events  []string          `json:"events,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
}

type CloseRequest

type CloseRequest struct {
	SessionID string `json:"sessionId"`
}

type ContextInspection

type ContextInspection struct {
	SessionID string      `json:"sessionId"`
	Path      string      `json:"path,omitempty"`
	Found     bool        `json:"found"`
	Value     interface{} `json:"value,omitempty"`
}

type DebugCommandRequest

type DebugCommandRequest struct {
	SessionID   string      `json:"sessionId"`
	OperationID string      `json:"operationId"`
	Command     string      `json:"command"`
	Breakpoint  *debug.Step `json:"breakpoint,omitempty"`
}

type DebugState

type DebugState = debug.State

type GetLoggingRequest

type GetLoggingRequest struct {
	SessionID string `json:"sessionId"`
}

type GetOperationRequest

type GetOperationRequest struct {
	SessionID   string `json:"sessionId"`
	OperationID string `json:"operationId"`
}

type InspectContextRequest

type InspectContextRequest struct {
	SessionID   string `json:"sessionId"`
	OperationID string `json:"operationId,omitempty"`
	Full        bool   `json:"full,omitempty"`
	Path        string `json:"path,omitempty"`
}

type ListOperationsRequest

type ListOperationsRequest struct {
	SessionID string `json:"sessionId"`
}

type ListOperationsResponse

type ListOperationsResponse struct {
	SessionID  string       `json:"sessionId"`
	Operations []*Operation `json:"operations"`
}

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions []*SessionInfo `json:"sessions"`
}

type ListTasksRequest added in v0.91.0

type ListTasksRequest struct {
	SessionID       string `json:"sessionId"`
	Workflow        string `json:"workflow"`
	Path            string `json:"path,omitempty"`
	ExpandWorkflows bool   `json:"expandWorkflows,omitempty"`
}

ListTasksRequest discovers task paths and expanded template instances without execution.

type ListTasksResponse added in v0.91.0

type ListTasksResponse struct {
	SessionID string      `json:"sessionId"`
	Workflow  string      `json:"workflow"`
	Tasks     []*TaskInfo `json:"tasks"`
}

type ListWorkflowsRequest

type ListWorkflowsRequest struct {
	SessionID string `json:"sessionId"`
}

type ListWorkflowsResponse

type ListWorkflowsResponse struct {
	SessionID string            `json:"sessionId"`
	Workflows []*LoadedWorkflow `json:"workflows"`
}

type LoadWorkflowRequest

type LoadWorkflowRequest struct {
	SessionID string `json:"sessionId"`
	URL       string `json:"url"`
	Name      string `json:"name,omitempty"`
	Alias     string `json:"alias,omitempty"`
	Replace   bool   `json:"replace,omitempty"`
	Content   string `json:"content,omitempty"`
	Format    string `json:"format,omitempty"`
}

type LoadedWorkflow

type LoadedWorkflow struct {
	SessionID string   `json:"sessionId"`
	Alias     string   `json:"alias"`
	Name      string   `json:"name"`
	Source    string   `json:"source"`
	Tasks     []string `json:"tasks"`
}

type LoggingState

type LoggingState struct {
	SessionID string `json:"sessionId"`
	Enabled   bool   `json:"enabled"`
}

type ManagerFactory

type ManagerFactory func() endly.Manager

type OpenRequest

type OpenRequest struct {
	Name    string `json:"name,omitempty"`
	Subject string `json:"-"`
}

type Operation

type Operation struct {
	ID               string                 `json:"id"`
	SessionID        string                 `json:"sessionId"`
	Status           string                 `json:"status"`
	Kind             string                 `json:"kind"`
	Workflow         string                 `json:"workflow"`
	Service          string                 `json:"service,omitempty"`
	Action           string                 `json:"action,omitempty"`
	Tasks            string                 `json:"tasks"`
	TagIDs           string                 `json:"tagIds,omitempty"`
	CreatedAt        time.Time              `json:"createdAt"`
	StartedAt        *time.Time             `json:"startedAt,omitempty"`
	FinishedAt       *time.Time             `json:"finishedAt,omitempty"`
	Result           map[string]interface{} `json:"result,omitempty"`
	Error            string                 `json:"error,omitempty"`
	Events           []*OperationEvent      `json:"events,omitempty"`
	Debug            *DebugState            `json:"debug,omitempty"`
	PassedAssertions int                    `json:"passedAssertions,omitempty"`
	FailedAssertions int                    `json:"failedAssertions,omitempty"`
	DroppedEvents    int64                  `json:"droppedEvents,omitempty"`
	// contains filtered or unexported fields
}

type OperationEvent

type OperationEvent struct {
	Sequence    int64           `json:"sequence"`
	Type        string          `json:"type"`
	EndlyType   string          `json:"endlyType,omitempty"`
	Timestamp   time.Time       `json:"timestamp"`
	Value       interface{}     `json:"value,omitempty"`
	Messages    []*msg.Message  `json:"messages,omitempty"`
	Activity    *model.Activity `json:"activity,omitempty"`
	ActivityEnd bool            `json:"activityEnd,omitempty"`
}

type Option

type Option func(*Service)

func WithAllowedActions

func WithAllowedActions(actions ...string) Option

func WithCallbackHTTPClient

func WithCallbackHTTPClient(client *http.Client) Option

func WithCallbackHosts

func WithCallbackHosts(hosts ...string) Option

func WithMaxEvents

func WithMaxEvents(limit int) Option

func WithMaxSessions

func WithMaxSessions(limit int) Option

func WithOperationRetention

func WithOperationRetention(retention time.Duration) Option

func WithPrivateCallbacks

func WithPrivateCallbacks(enabled bool) Option

func WithSessionTTL

func WithSessionTTL(ttl time.Duration) Option

type RunActionRequest

type RunActionRequest struct {
	SessionID     string                 `json:"sessionId"`
	Service       string                 `json:"service"`
	Action        string                 `json:"action"`
	Request       map[string]interface{} `json:"request,omitempty"`
	Callbacks     []Callback             `json:"callbacks,omitempty"`
	TimeoutMillis int64                  `json:"timeoutMillis,omitempty"`
}

type RunWorkflowRequest

type RunWorkflowRequest struct {
	SessionID         string                 `json:"sessionId"`
	Workflow          string                 `json:"workflow"`
	Tasks             string                 `json:"tasks,omitempty"`
	TagIDs            string                 `json:"tagIds,omitempty"`
	SelectorMode      string                 `json:"selectorMode,omitempty"`
	Params            map[string]interface{} `json:"params,omitempty"`
	SharedState       *bool                  `json:"sharedState,omitempty"`
	Callbacks         []Callback             `json:"callbacks,omitempty"`
	Debug             bool                   `json:"debug,omitempty"`
	Breakpoints       []debug.Step           `json:"breakpoints,omitempty"`
	Timeout           time.Duration          `json:"-"`
	TimeoutMillis     int64                  `json:"timeoutMillis,omitempty"`
	PublishParameters *bool                  `json:"publishParameters,omitempty"`
}

type Service

type Service struct {
	*endly.AbstractService
	// contains filtered or unexported fields
}

func New

func New(factory ManagerFactory, options ...Option) *Service

func (*Service) Close

func (s *Service) Close(ctx context.Context, sessionID string) error

func (*Service) DebugCommand

func (s *Service) DebugCommand(request *DebugCommandRequest) (*DebugState, error)

func (*Service) DebugState

func (s *Service) DebugState(sessionID, operationID string) (*DebugState, error)

func (*Service) GetOperation

func (s *Service) GetOperation(sessionID, operationID string) (*Operation, error)

func (*Service) InspectContext

func (s *Service) InspectContext(request *InspectContextRequest) (*ContextInspection, error)

func (*Service) ListOperations

func (s *Service) ListOperations(sessionID string) (*ListOperationsResponse, error)

func (*Service) ListTasks added in v0.91.0

func (s *Service) ListTasks(request *ListTasksRequest) (*ListTasksResponse, error)

ListTasks reflects the decoded workflow, including template expansion performed by the ordinary Endly loader. It performs no setup or test actions.

func (*Service) ListWorkflows

func (s *Service) ListWorkflows(sessionID string) (*ListWorkflowsResponse, error)

func (*Service) LoadWorkflow

func (s *Service) LoadWorkflow(ctx context.Context, request *LoadWorkflowRequest) (*LoadedWorkflow, error)

func (*Service) Logging

func (s *Service) Logging(sessionID string) (*LoggingState, error)

func (*Service) Open

func (s *Service) Open(ctx context.Context, request *OpenRequest) (*SessionInfo, error)

func (*Service) Session

func (s *Service) Session(sessionID string) (*SessionInfo, error)

func (*Service) Sessions

func (s *Service) Sessions() *ListSessionsResponse

func (*Service) SetLogging

func (s *Service) SetLogging(request *SetLoggingRequest) (*LoggingState, error)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

func (*Service) StartAction

func (s *Service) StartAction(request *RunActionRequest) (*Operation, error)

func (*Service) StartJanitor

func (s *Service) StartJanitor(ctx context.Context, interval time.Duration)

func (*Service) StartWorkflow

func (s *Service) StartWorkflow(request *RunWorkflowRequest) (*Operation, error)

func (*Service) StopOperation

func (s *Service) StopOperation(sessionID, operationID string) (*Operation, error)

func (*Service) UnloadWorkflow

func (s *Service) UnloadWorkflow(request *UnloadWorkflowRequest) error

func (*Service) WaitOperation

func (s *Service) WaitOperation(ctx context.Context, sessionID, operationID string) (*Operation, error)

type Session

type Session struct {
	// contains filtered or unexported fields
}

type SessionInfo

type SessionInfo struct {
	SessionID string    `json:"sessionId"`
	Name      string    `json:"name,omitempty"`
	Subject   string    `json:"subject,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
}

type SetLoggingRequest

type SetLoggingRequest struct {
	SessionID string `json:"sessionId"`
	Enabled   bool   `json:"enabled"`
}

type StartOperationRequest

type StartOperationRequest struct {
	Kind     string              `json:"kind"`
	Workflow *RunWorkflowRequest `json:"workflow,omitempty"`
	Action   *RunActionRequest   `json:"action,omitempty"`
}

type StopOperationRequest

type StopOperationRequest = GetOperationRequest

type TaskActionInfo added in v0.91.0

type TaskActionInfo struct {
	Name    string `json:"name"`
	Service string `json:"service"`
	Action  string `json:"action"`
	TagID   string `json:"tagId,omitempty"`
	Skip    string `json:"skip,omitempty"`
}

type TaskInfo added in v0.91.0

type TaskInfo struct {
	Name      string                  `json:"name"`
	Path      string                  `json:"path"`
	Tasks     []*TaskInfo             `json:"tasks,omitempty"`
	Actions   []TaskActionInfo        `json:"actions,omitempty"`
	Instances []*TemplateInstanceInfo `json:"instances,omitempty"`
	Workflows []*WorkflowTaskInfo     `json:"workflows,omitempty"`
}

type TemplateInstanceInfo added in v0.91.0

type TemplateInstanceInfo struct {
	TagID       string           `json:"tagId"`
	Index       string           `json:"index,omitempty"`
	Tag         string           `json:"tag,omitempty"`
	Description string           `json:"description,omitempty"`
	Actions     []TaskActionInfo `json:"actions"`
}

type UnloadWorkflowRequest

type UnloadWorkflowRequest struct {
	SessionID string `json:"sessionId"`
	Workflow  string `json:"workflow"`
	Force     bool   `json:"force,omitempty"`
}

type ValidationError

type ValidationError struct{ Message string }

func (*ValidationError) Error

func (e *ValidationError) Error() string

type WorkflowTaskInfo added in v0.91.0

type WorkflowTaskInfo struct {
	Name   string      `json:"name"`
	Source string      `json:"source"`
	Tasks  []*TaskInfo `json:"tasks"`
}

WorkflowTaskInfo identifies a nested run boundary, whose paths belong to its workflow.

Jump to

Keyboard shortcuts

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