api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 19 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, conf *config.Config, 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(id string) (*config.Workflow, error)

func (*API) GetWorkflowFromWorkflowRunID

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

func (*API) GetWorkflows

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

func (*API) Handler

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

func (*API) PreviewDataset

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

func (*API) ReadDataConnection

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

func (*API) ScheduleTask

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

func (*API) StartWorkflow

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

func (*API) StoreDataConnection

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

func (*API) StoreDataset

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

func (*API) StoreWorkflow

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

type DataConnection

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

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 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"`
	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