Documentation
¶
Index ¶
- func Execute()
- func RunInstallWorkflow(cmd *cobra.Command, args []string) error
- func SetBuildInfo(bt, ch string)
- func UsageAgent() string
- func UsageAllExamples() string
- func UsageAssets() string
- func UsageClient() string
- func UsageClientExec() string
- func UsageClientFetch() string
- func UsageClientRun() string
- func UsageConfig() string
- func UsageConfigClean() string
- func UsageConfigList() string
- func UsageConfigSet() string
- func UsageConfigView() string
- func UsageDB() string
- func UsageDBClean() string
- func UsageDBList() string
- func UsageDBMigrate() string
- func UsageDBSeed() string
- func UsageFullExample() string
- func UsageFunction() string
- func UsageFunctionEval() string
- func UsageHealth() string
- func UsageInstall() string
- func UsageQuery() string
- func UsageQueryRuns() string
- func UsageQuerySteps() string
- func UsageQueryVulns() string
- func UsageRoot() string
- func UsageRun() string
- func UsageRunCancel() string
- func UsageRunStatus() string
- func UsageServe() string
- func UsageSnapshot() string
- func UsageUninstall() string
- func UsageUpdate() string
- func UsageWorker() string
- func UsageWorkerEval() string
- func UsageWorkerJoin() string
- func UsageWorkerQueue() string
- func UsageWorkerQueueList() string
- func UsageWorkerQueueNew() string
- func UsageWorkerQueueRun() string
- func UsageWorkerSet() string
- func UsageWorkerStatus() string
- func UsageWorkflow() string
- type ChunkInfo
- type CreateRunRequest
- type CreateRunResponse
- type QueuePoller
- type QueuePollerConfig
- type QueuedTask
- type RunClient
- type ScheduleClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately.
func RunInstallWorkflow ¶ added in v5.0.1
RunInstallWorkflow installs workflows from a source (exported for use by workflow install alias)
func SetBuildInfo ¶
func SetBuildInfo(bt, ch string)
SetBuildInfo sets the build time and commit hash for version display This must be called before Execute() to ensure version output is correct
func UsageAgent ¶ added in v5.0.1
func UsageAgent() string
docsFooter returns the documentation footer UsageAgent returns the Long description for the agent command
func UsageAllExamples ¶
func UsageAllExamples() string
UsageAllExamples returns comprehensive usage examples for all commands
func UsageAssets ¶ added in v5.0.1
func UsageAssets() string
UsageAssets returns the Long description for the assets command
func UsageClient ¶
func UsageClient() string
UsageClient returns the Long description for the client command
func UsageClientExec ¶
func UsageClientExec() string
UsageClientExec returns the Long description for the client exec command
func UsageClientFetch ¶
func UsageClientFetch() string
UsageClientFetch returns the Long description for the client fetch command
func UsageClientRun ¶
func UsageClientRun() string
UsageClientRun returns the Long description for the client run command
func UsageConfig ¶
func UsageConfig() string
UsageConfig returns the Long description for the config command
func UsageConfigClean ¶
func UsageConfigClean() string
UsageConfigClean returns the Long description for the config clean command
func UsageConfigList ¶
func UsageConfigList() string
func UsageConfigSet ¶
func UsageConfigSet() string
UsageConfigSet returns the Long description for the config set command
func UsageConfigView ¶
func UsageConfigView() string
func UsageDBClean ¶
func UsageDBClean() string
UsageDBClean returns the Long description for the db clean command
func UsageDBList ¶
func UsageDBList() string
UsageDBList returns the Long description for the db list command
func UsageDBMigrate ¶
func UsageDBMigrate() string
UsageDBMigrate returns the Long description for the db migrate command
func UsageDBSeed ¶
func UsageDBSeed() string
UsageDBSeed returns the Long description for the db seed command
func UsageFullExample ¶
func UsageFullExample() string
UsageFullExample returns comprehensive usage with all flags for pager display
func UsageFunction ¶
func UsageFunction() string
UsageFunction returns the Long description for the function command
func UsageFunctionEval ¶
func UsageFunctionEval() string
UsageFunctionEval returns the Long description for the function eval command
func UsageHealth ¶
func UsageHealth() string
UsageHealth returns the Long description for the health command
func UsageInstall ¶
func UsageInstall() string
UsageInstall returns the Long description for the install command
func UsageQuery ¶ added in v5.0.2
func UsageQuery() string
UsageQuery returns the Long description for the query command
func UsageQueryRuns ¶ added in v5.0.2
func UsageQueryRuns() string
UsageQueryRuns returns the Long description for the query runs command
func UsageQuerySteps ¶ added in v5.0.2
func UsageQuerySteps() string
UsageQuerySteps returns the Long description for the query steps command
func UsageQueryVulns ¶ added in v5.0.2
func UsageQueryVulns() string
UsageQueryVulns returns the Long description for the query vulns command
func UsageRoot ¶
func UsageRoot() string
UsageRoot returns the Long description for the root command
func UsageRunCancel ¶ added in v5.0.2
func UsageRunCancel() string
UsageRunCancel returns the Long description for the run cancel command
func UsageRunStatus ¶ added in v5.0.2
func UsageRunStatus() string
UsageRunStatus returns the Long description for the run status command
func UsageServe ¶
func UsageServe() string
UsageServe returns the Long description for the serve command
func UsageSnapshot ¶
func UsageSnapshot() string
UsageSnapshot returns usage text for snapshot command
func UsageUninstall ¶ added in v5.0.1
func UsageUninstall() string
UsageUninstall returns the Long description for the uninstall command
func UsageUpdate ¶
func UsageUpdate() string
UsageUpdate returns the Long description for the update command
func UsageWorker ¶
func UsageWorker() string
UsageWorker returns the Long description for the worker command
func UsageWorkerEval ¶ added in v5.0.1
func UsageWorkerEval() string
UsageWorkerEval returns the Long description for the worker eval command
func UsageWorkerJoin ¶
func UsageWorkerJoin() string
UsageWorkerJoin returns the Long description for the worker join command
func UsageWorkerQueue ¶ added in v5.0.1
func UsageWorkerQueue() string
UsageWorkerQueue returns the Long description for the worker queue command
func UsageWorkerQueueList ¶ added in v5.0.1
func UsageWorkerQueueList() string
UsageWorkerQueueList returns the Long description for the worker queue list command
func UsageWorkerQueueNew ¶ added in v5.0.1
func UsageWorkerQueueNew() string
UsageWorkerQueueNew returns the Long description for the worker queue new command
func UsageWorkerQueueRun ¶ added in v5.0.1
func UsageWorkerQueueRun() string
UsageWorkerQueueRun returns the Long description for the worker queue run command
func UsageWorkerSet ¶ added in v5.0.1
func UsageWorkerSet() string
UsageWorkerSet returns the Long description for the worker set command
func UsageWorkerStatus ¶
func UsageWorkerStatus() string
UsageWorkerStatus returns the Long description for the worker status command
func UsageWorkflow ¶
func UsageWorkflow() string
UsageWorkflow returns the Long description for the workflow command
Types ¶
type CreateRunRequest ¶ added in v5.0.1
type CreateRunRequest struct {
Flow string `json:"flow,omitempty"`
Module string `json:"module,omitempty"`
Target string `json:"target,omitempty"`
Targets []string `json:"targets,omitempty"`
Params map[string]string `json:"params,omitempty"`
Concurrency int `json:"concurrency,omitempty"`
Priority string `json:"priority,omitempty"`
RunMode string `json:"run_mode,omitempty"`
ThreadsHold int `json:"threads_hold,omitempty"`
HeuristicsCheck string `json:"heuristics_check,omitempty"`
EmptyTarget bool `json:"empty_target,omitempty"`
}
CreateRunRequest represents a request to create a new run via the API
type CreateRunResponse ¶ added in v5.0.1
type CreateRunResponse struct {
Message string `json:"message"`
Workflow string `json:"workflow"`
Kind string `json:"kind"`
TargetCount int `json:"target_count"`
Priority string `json:"priority"`
JobID string `json:"job_id"`
Status string `json:"status"`
PollURL string `json:"poll_url"`
RunUUID string `json:"run_uuid,omitempty"`
}
CreateRunResponse represents the response from creating a run
type QueuePoller ¶ added in v5.0.1
type QueuePoller struct {
// contains filtered or unexported fields
}
QueuePoller polls DB (and optionally Redis) for queued runs and executes them.
func NewQueuePoller ¶ added in v5.0.1
func NewQueuePoller(cfg *config.Config, pollerCfg QueuePollerConfig) *QueuePoller
NewQueuePoller creates a new QueuePoller. Call Start to begin processing.
func (*QueuePoller) Start ¶ added in v5.0.1
func (qp *QueuePoller) Start(ctx context.Context) error
Start connects to the database, starts pollers and executor goroutines. It returns immediately after launching goroutines. Use Stop to shut down.
func (*QueuePoller) Stop ¶ added in v5.0.1
func (qp *QueuePoller) Stop()
Stop cancels the poller context and waits for all goroutines to finish.
type QueuePollerConfig ¶ added in v5.0.1
type QueuePollerConfig struct {
DBPollInterval time.Duration // e.g. 5s for worker queue run, 30s for server
RedisBRPOPTimeout time.Duration // default 5s
Concurrency int // number of parallel executors
RedisURL string // optional override (applied before Start)
}
QueuePollerConfig holds configuration for a QueuePoller instance.
type QueuedTask ¶ added in v5.0.1
type QueuedTask struct {
Source string // "redis" or "db"
RunUUID string
RunID int64
WorkflowName string
WorkflowKind string
Target string
Params map[string]interface{}
InputIsFile bool
InputFilePath string
}
QueuedTask represents a task picked from either Redis or DB
type RunClient ¶ added in v5.0.1
type RunClient struct {
// contains filtered or unexported fields
}
RunClient handles run submission to the osmedeus server
func NewRunClient ¶ added in v5.0.1
NewRunClient creates a new RunClient from config
func (*RunClient) CreateRun ¶ added in v5.0.1
func (c *RunClient) CreateRun(ctx context.Context, req *CreateRunRequest) (*CreateRunResponse, error)
CreateRun POSTs to /osm/api/runs to create a new run
func (*RunClient) IsServerAvailable ¶ added in v5.0.1
IsServerAvailable checks if the server is reachable via GET /server-info
func (*RunClient) SetBaseURL ¶ added in v5.0.1
SetBaseURL overrides the base URL (for --server-url flag)
type ScheduleClient ¶ added in v5.0.1
type ScheduleClient struct {
// contains filtered or unexported fields
}
ScheduleClient handles schedule registration with the osmedeus server
func NewScheduleClient ¶ added in v5.0.1
func NewScheduleClient(cfg *config.Config) *ScheduleClient
NewScheduleClient creates a client from config
func (*ScheduleClient) IsServerAvailable ¶ added in v5.0.1
func (c *ScheduleClient) IsServerAvailable() bool
IsServerAvailable checks if the server is reachable via GET /osm/server-info
func (*ScheduleClient) RegisterCronTrigger ¶ added in v5.0.1
func (c *ScheduleClient) RegisterCronTrigger(ctx context.Context, workflow *core.Workflow, trigger *core.Trigger, target string, params map[string]string) error
RegisterCronTrigger POSTs to /osm/api/schedules to register a cron trigger Returns nil on 201 Created or 409 Conflict (schedule already exists)
func (*ScheduleClient) SetBaseURL ¶ added in v5.0.1
func (c *ScheduleClient) SetBaseURL(url string)
SetBaseURL overrides the base URL (for --server-url flag)