interfaces

package
v1.1.131 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountResourceInput added in v1.1.36

type CountResourceInput struct {
	InlineFilters []common.InlineFilter
	// MapFilters refers to primary entity filters defined as map values rather than inline sql queries.
	// These exist to permit filtering on "IS NULL" which isn't permitted with inline filter queries and
	// pq driver value substitution.
	MapFilters []common.MapFilter
	// A set of the entities (besides the primary table being queried) that should be joined with when performing
	// the count query. This enables filtering on non-primary entity attributes.
	JoinTableEntities map[common.Entity]bool
}

Parameters for counting multiple resources.

type DescriptionEntityCollectionOutput added in v1.1.67

type DescriptionEntityCollectionOutput struct {
	Entities []models.DescriptionEntity
}

type DescriptionEntityRepoInterface added in v1.1.67

type DescriptionEntityRepoInterface interface {
	// Get Returns a matching DescriptionEntity if it exists.
	Get(ctx context.Context, input GetDescriptionEntityInput) (models.DescriptionEntity, error)
	// List Returns DescriptionEntity matching query parameters. A limit must be provided for the results page size
	List(ctx context.Context, input ListResourceInput) (DescriptionEntityCollectionOutput, error)
}

DescriptionEntityRepoInterface Defines the interface for interacting with Description models.

type ExecutionCollectionOutput

type ExecutionCollectionOutput struct {
	Executions []models.Execution
}

Response format for a query on workflows.

type ExecutionEventRepoInterface added in v0.4.12

type ExecutionEventRepoInterface interface {
	// Inserts a workflow execution event into the database store.
	Create(ctx context.Context, input models.ExecutionEvent) error
}

type ExecutionRepoInterface

type ExecutionRepoInterface interface {
	// Inserts a workflow execution model into the database store.
	Create(ctx context.Context, input models.Execution) error
	// This updates only an existing execution model with all non-empty fields in the input.
	Update(ctx context.Context, execution models.Execution) error
	// Returns a matching execution if it exists.
	Get(ctx context.Context, input Identifier) (models.Execution, error)
	// Returns executions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (ExecutionCollectionOutput, error)
	// Returns count of executions matching query parameters.
	Count(ctx context.Context, input CountResourceInput) (int64, error)
}

Defines the interface for interacting with workflow execution models.

type GetDescriptionEntityInput added in v1.1.67

type GetDescriptionEntityInput struct {
	ResourceType core.ResourceType
	Project      string
	Domain       string
	Name         string
	Version      string
}

type GetNamedEntityInput added in v0.1.5

type GetNamedEntityInput struct {
	ResourceType core.ResourceType
	Project      string
	Domain       string
	Name         string
}

type GetSignalInput added in v1.1.61

type GetSignalInput struct {
	SignalID core.SignalIdentifier
}

type GetTaskExecutionInput

type GetTaskExecutionInput struct {
	TaskExecutionID core.TaskExecutionIdentifier
}

type Identifier added in v0.4.6

type Identifier struct {
	Project string
	Domain  string
	Name    string
	Version string
}

Parameters for getting an individual resource.

type LaunchPlanCollectionOutput

type LaunchPlanCollectionOutput struct {
	LaunchPlans []models.LaunchPlan
}

Response format for a query on workflows.

type LaunchPlanRepoInterface

type LaunchPlanRepoInterface interface {
	// Inserts a launch plan model into the database store.
	Create(ctx context.Context, input models.LaunchPlan) error
	// Updates an existing launch plan in the database store.
	Update(ctx context.Context, input models.LaunchPlan) error
	// Sets the state to active for an existing launch plan in the database store
	// (and deactivates the formerly active version if the toDisable model exists).
	SetActive(ctx context.Context, toEnable models.LaunchPlan, toDisable *models.LaunchPlan) error
	// Returns a matching launch plan if it exists.
	Get(ctx context.Context, input Identifier) (models.LaunchPlan, error)
	// Returns launch plan revisions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (LaunchPlanCollectionOutput, error)
	// Returns a list of identifiers for launch plans.  A limit must be provided for the results page size.
	ListLaunchPlanIdentifiers(ctx context.Context, input ListResourceInput) (LaunchPlanCollectionOutput, error)
}

Defines the interface for interacting with launch plan models.

type ListNamedEntityInput added in v0.3.38

type ListNamedEntityInput struct {
	ListResourceInput
	Project      string
	Domain       string
	ResourceType core.ResourceType
}

Parameters for querying multiple resources.

type ListResourceInput

type ListResourceInput struct {
	Limit         int
	Offset        int
	InlineFilters []common.InlineFilter
	// MapFilters refers to primary entity filters defined as map values rather than inline sql queries.
	// These exist to permit filtering on "IS NULL" which isn't permitted with inline filter queries and
	// pq driver value substitution.
	MapFilters    []common.MapFilter
	SortParameter common.SortParameter
	// A set of the entities (besides the primary table being queried) that should be joined with when performing
	// the list query. This enables filtering on non-primary entity attributes.
	JoinTableEntities map[common.Entity]bool
}

Parameters for querying multiple resources.

type NamedEntityCollectionOutput added in v0.1.5

type NamedEntityCollectionOutput struct {
	Entities []models.NamedEntity
}

type NamedEntityRepoInterface added in v0.1.5

type NamedEntityRepoInterface interface {
	// Returns NamedEntity objects matching the provided query. A limit is
	// required
	List(ctx context.Context, input ListNamedEntityInput) (NamedEntityCollectionOutput, error)
	// Updates NamedEntity record, will create metadata if it does not exist
	Update(ctx context.Context, input models.NamedEntity) error
	// Gets metadata (if available) associated with a NamedEntity
	Get(ctx context.Context, input GetNamedEntityInput) (models.NamedEntity, error)
}

Defines the interface for interacting with NamedEntity models

type NodeExecutionCollectionOutput

type NodeExecutionCollectionOutput struct {
	NodeExecutions []models.NodeExecution
}

Response format for a query on node executions.

type NodeExecutionEventCollectionOutput

type NodeExecutionEventCollectionOutput struct {
	NodeExecutionEvents []models.NodeExecutionEvent
}

Response format for a query on node execution events.

type NodeExecutionEventRepoInterface added in v0.4.12

type NodeExecutionEventRepoInterface interface {
	// Inserts a node execution event into the database store.
	Create(ctx context.Context, input models.NodeExecutionEvent) error
}

type NodeExecutionRepoInterface

type NodeExecutionRepoInterface interface {
	// Create a new node execution model and the first event that triggers it into the database store.
	Create(ctx context.Context, execution *models.NodeExecution) error
	// Update an existing node execution in the database store with all non-empty fields in the input.
	Update(ctx context.Context, execution *models.NodeExecution) error
	// Get returns a matching execution if it exists.
	Get(ctx context.Context, input NodeExecutionResource) (models.NodeExecution, error)
	// GetWithChildren returns a matching execution with preloaded child node executions. This should only be called for legacy node executions
	// which were created with eventVersion == 0
	GetWithChildren(ctx context.Context, input NodeExecutionResource) (models.NodeExecution, error)
	// List returns node executions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (NodeExecutionCollectionOutput, error)
	// Exists returns whether a matching execution exists.
	Exists(ctx context.Context, input NodeExecutionResource) (bool, error)
	// Returns count of node executions matching query parameters.
	Count(ctx context.Context, input CountResourceInput) (int64, error)
}

Defines the interface for interacting with node execution models.

type NodeExecutionResource added in v0.4.6

type NodeExecutionResource struct {
	NodeExecutionIdentifier core.NodeExecutionIdentifier
}

type ProjectRepoInterface

type ProjectRepoInterface interface {
	// Inserts a namespace model into the database store.
	Create(ctx context.Context, project models.Project) error
	// Returns a matching project when it exists.
	Get(ctx context.Context, projectID string) (models.Project, error)
	// Returns projects matching query parameters.
	List(ctx context.Context, input ListResourceInput) ([]models.Project, error)
	// Given a project that exists in the DB and a partial set of fields to update
	// as a second project (projectUpdate), updates the original project which already
	// exists in the DB.
	UpdateProject(ctx context.Context, projectUpdate models.Project) error
}

type Repository added in v0.6.100

type Repository interface {
	TaskRepo() TaskRepoInterface
	WorkflowRepo() WorkflowRepoInterface
	LaunchPlanRepo() LaunchPlanRepoInterface
	ExecutionRepo() ExecutionRepoInterface
	ExecutionEventRepo() ExecutionEventRepoInterface
	ProjectRepo() ProjectRepoInterface
	ResourceRepo() ResourceRepoInterface
	NodeExecutionRepo() NodeExecutionRepoInterface
	NodeExecutionEventRepo() NodeExecutionEventRepoInterface
	TaskExecutionRepo() TaskExecutionRepoInterface
	NamedEntityRepo() NamedEntityRepoInterface
	DescriptionEntityRepo() DescriptionEntityRepoInterface
	SchedulableEntityRepo() schedulerInterfaces.SchedulableEntityRepoInterface
	ScheduleEntitiesSnapshotRepo() schedulerInterfaces.ScheduleEntitiesSnapShotRepoInterface
	SignalRepo() SignalRepoInterface

	GetGormDB() *gorm.DB
}

The Repository indicates the methods that each Repository must support. A Repository indicates a Database which is collection of Tables/models. The goal is allow databases to be Plugged in easily.

type ResourceID added in v0.3.38

type ResourceID struct {
	Project      string
	Domain       string
	Workflow     string
	LaunchPlan   string
	ResourceType string
}

type ResourceRepoInterface added in v0.3.38

type ResourceRepoInterface interface {
	// Inserts or updates an existing Type model into the database store.
	CreateOrUpdate(ctx context.Context, input models.Resource) error
	// Returns a matching Type model based on hierarchical resolution.
	Get(ctx context.Context, ID ResourceID) (models.Resource, error)
	// Returns a matching Type model.
	GetRaw(ctx context.Context, ID ResourceID) (models.Resource, error)
	// GetProjectLevel returns the Project level resource entry, if any, even if there is a higher
	// specificity resource.
	GetProjectLevel(ctx context.Context, ID ResourceID) (models.Resource, error)
	// Lists all resources
	ListAll(ctx context.Context, resourceType string) ([]models.Resource, error)
	// Deletes a matching Type model when it exists.
	Delete(ctx context.Context, ID ResourceID) error
}

type SetStateInput

type SetStateInput struct {
	Identifier core.Identifier
	Version    string
	Closure    []byte
}

type SignalRepoInterface added in v1.1.61

type SignalRepoInterface interface {
	// Get retrieves a signal model from the database store.
	Get(ctx context.Context, input models.SignalKey) (models.Signal, error)
	// GetOrCreate inserts a signal model into the database store or returns one if it already exists.
	GetOrCreate(ctx context.Context, input *models.Signal) error
	// List all signals that match the input values.
	List(ctx context.Context, input ListResourceInput) ([]models.Signal, error)
	// Update sets the value on a signal in the database store.
	Update(ctx context.Context, input models.SignalKey, value []byte) error
}

Defines the interface for interacting with signal models.

type TaskCollectionOutput

type TaskCollectionOutput struct {
	Tasks []models.Task
}

Response format for a query on tasks.

type TaskExecutionCollectionOutput

type TaskExecutionCollectionOutput struct {
	TaskExecutions []models.TaskExecution
}

Response format for a query on task executions.

type TaskExecutionRepoInterface

type TaskExecutionRepoInterface interface {
	// Inserts a task execution model into the database store.
	Create(ctx context.Context, input models.TaskExecution) error
	// Updates an existing task execution in the database store with all non-empty fields in the input.
	Update(ctx context.Context, execution models.TaskExecution) error
	// Returns a matching execution if it exists.
	Get(ctx context.Context, input GetTaskExecutionInput) (models.TaskExecution, error)
	// Returns task executions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (TaskExecutionCollectionOutput, error)
	// Returns count of task executions matching query parameters.
	Count(ctx context.Context, input CountResourceInput) (int64, error)
}

Defines the interface for interacting with task execution models.

type TaskRepoInterface

type TaskRepoInterface interface {
	// Inserts a task model into the database store.
	Create(ctx context.Context, input models.Task, descriptionEntity *models.DescriptionEntity) error
	// Returns a matching task if it exists.
	Get(ctx context.Context, input Identifier) (models.Task, error)
	// Returns task revisions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (TaskCollectionOutput, error)
	// Returns tasks with only the project, name, and domain filled in.
	// A limit must be provided.
	ListTaskIdentifiers(ctx context.Context, input ListResourceInput) (TaskCollectionOutput, error)
}

Defines the interface for interacting with Task models.

type UpdateResourceInput

type UpdateResourceInput struct {
	Filters    []common.InlineFilter
	Attributes map[string]interface{}
}

Describes a set of resources for which to apply attribute updates.

type WorkflowCollectionOutput

type WorkflowCollectionOutput struct {
	Workflows []models.Workflow
}

Response format for a query on workflows.

type WorkflowRepoInterface

type WorkflowRepoInterface interface {
	// Inserts a workflow model into the database store.
	Create(ctx context.Context, input models.Workflow, descriptionEntity *models.DescriptionEntity) error
	// Returns a matching workflow if it exists.
	Get(ctx context.Context, input Identifier) (models.Workflow, error)
	// Returns workflow revisions matching query parameters. A limit must be provided for the results page size.
	List(ctx context.Context, input ListResourceInput) (WorkflowCollectionOutput, error)
	ListIdentifiers(ctx context.Context, input ListResourceInput) (WorkflowCollectionOutput, error)
}

Defines the interface for interacting with Workflow models.

Jump to

Keyboard shortcuts

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