api

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(db *sql.DB, configSource, configPath string, dataDir string) (*API, error)

NewAPI returns a new API instance.

func (*API) CompleteWorkflowRun

func (api *API) CompleteWorkflowRun(id string, success bool) error

func (*API) GetWorkflow

func (api *API) GetWorkflow(hash, id string) (*config.Workflow, error)

func (*API) GetWorkflowFromWorkflowRunID

func (api *API) GetWorkflowFromWorkflowRunID(workflowRunID string) (*config.Workflow, error)

func (*API) GetWorkflows

func (api *API) GetWorkflows(hash string) (map[string]config.Workflow, error)

func (*API) Handler

func (api *API) Handler() http.Handler

func (*API) LatestConfigHash added in v0.2.2

func (api *API) LatestConfigHash() (string, error)

func (*API) LoadConfig added in v0.2.2

func (api *API) LoadConfig() error

func (*API) PreviewDataset

func (api *API) PreviewDataset(id string) ([]interface{}, error)

func (*API) ReadDataConnection

func (api *API) ReadDataConnection(hash, id string) (*config.DataConnection, error)

func (*API) ReadDatasets added in v0.2.2

func (api *API) ReadDatasets() ([]config.Dataset, error)

func (*API) ScheduleTask

func (api *API) ScheduleTask(workflowRunID string, workflowTaskID string, input map[string]interface{}) error

func (*API) StartWorkflow

func (api *API) StartWorkflow(hash, id string, workflowInput map[string]interface{}) error

func (*API) StoreDataConnection

func (api *API) StoreDataConnection(hash string, connection config.DataConnection) error

func (*API) StoreDataset

func (api *API) StoreDataset(hash string, dataset config.Dataset) error

func (*API) StoreWorkflow

func (api *API) StoreWorkflow(hash string, workflow config.Workflow) error

func (*API) Tick added in v0.2.2

func (api *API) Tick(now time.Time) error

type DataConnection

type DataConnection struct {
	ID               string `json:"id"`
	Type             string `json:"type"`
	Path             string `json:"path"`
	ConnectionString string `json:"connection_string"`
}

type GitHubContentResponse added in v0.2.2

type GitHubContentResponse struct {
	Name     string `json:"name"`
	Path     string `json:"path"`
	Content  string `json:"content"`
	Encoding string `json:"encoding"`
}

type Response

type Response struct {
	OK       bool        `json:"ok"`
	Status   int         `json:"-"`
	Error    string      `json:"error,omitempty"`
	Response interface{} `json:"response,omitempty"`
	// contains filtered or unexported fields
}

func CustomResponse

func CustomResponse() Response

type StatusSummary added in v0.2.1

type StatusSummary struct {
	RecentTaskRuns      []SummaryTaskRun `json:"recent_task_runs"`
	RecentTaskFailures  []SummaryTaskRun `json:"recent_task_failures"`
	TotalConnections    int              `json:"total_connections"`
	TotalDatasets       int              `json:"total_datasets"`
	TotalWorkflows      int              `json:"total_workflows"`
	TotalTasksCompleted int              `json:"total_tasks_completed"`
}

type SummaryTaskRun added in v0.2.1

type SummaryTaskRun struct {
	ID             string     `json:"id"`
	WorkflowID     string     `json:"workflow_id"`
	WorkflowRunID  string     `json:"workflow_run_id"`
	WorkflowTaskID string     `json:"workflow_task_id"`
	CreatedAt      time.Time  `json:"created_at"`
	StartedAt      *time.Time `json:"started_at"`
	CompletedAt    *time.Time `json:"completed_at"`
	Success        *bool      `json:"success"`
}

type Task

type Task struct {
	ID       string                 `json:"id"`
	Image    string                 `json:"image"`
	Script   string                 `json:"script"`
	Env      map[string]string      `yaml:"env"`
	Datasets []string               `json:"datasets"`
	Input    map[string]interface{} `yaml:"input"`
}

type TaskResult

type TaskResult struct {
	ID     string                 `json:"id"`
	OK     bool                   `json:"ok"`
	Output map[string]interface{} `json:"output"`
	Stdout string                 `json:"stdout"`
	Stderr string                 `json:"stderr"`
}

type TaskRun

type TaskRun struct {
	ID             string          `json:"id"`
	WorkflowRunID  string          `json:"workflow_run_id"`
	WorkflowTaskID string          `json:"workflow_task_id"`
	Input          json.RawMessage `json:"input"`
	Output         json.RawMessage `json:"output"`
	CreatedAt      time.Time       `json:"created_at"`
	StartedAt      *time.Time      `json:"started_at"`
	TimeoutAt      *time.Time      `json:"timeout_at"`
	CompletedAt    *time.Time      `json:"completed_at"`
	AttemptsLeft   int             `json:"attempts_left"`
	Stdout         *string         `json:"stdout"`
	Stderr         *string         `json:"stderr"`
	Success        *bool           `json:"success"`
}

type WorkflowRun

type WorkflowRun struct {
	ID          string     `json:"id"`
	ConfigHash  string     `json:"config_hash"`
	WorkflowID  string     `json:"workflow_id"`
	StartedAt   *time.Time `json:"started_at"`
	CompletedAt *time.Time `json:"completed_at"`
	Success     *bool      `json:"success"`
}

Jump to

Keyboard shortcuts

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