dao

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckParams

func CheckParams(params map[string]string) error

CheckParams checks if the params contain keywords. These keywords will reconginzed as the params like "{{input.parameters.xxx}}" of argo that may cause workflow execution failure.

func CreateWorkflowExecution added in v0.4.0

func CreateWorkflowExecution(
	ctx context.Context,
	mc model.ClientSet,
	opts CreateWorkflowExecutionOptions,
) (*model.WorkflowExecution, error)

func CreateWorkflowStageExecution added in v0.4.0

func CreateWorkflowStageExecution(
	ctx context.Context,
	mc model.ClientSet,
	opts CreateWorkflowStageExecutionOptions,
) (*model.WorkflowStageExecution, error)

func CreateWorkflowStepExecution added in v0.4.0

func CreateWorkflowStepExecution(
	ctx context.Context,
	mc model.ClientSet,
	opts CreateWorkflowStepExecutionOptions,
) (*model.WorkflowStepExecution, error)

func EnvironmentConnectorsEdgeSave

func EnvironmentConnectorsEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Environment) error

EnvironmentConnectorsEdgeSave saves the edge connectors of model.Environment entity.

func EnvironmentVariablesEdgeSave added in v0.4.0

func EnvironmentVariablesEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Environment) error

EnvironmentVariablesEdgeSave saves the edge variables of model.Environment entity.

func ExposeResourceDefinition added in v0.4.0

func ExposeResourceDefinition(_rd *model.ResourceDefinition) *model.ResourceDefinitionOutput

ExposeResourceDefinition converts the ResourceDefinition to ResourceDefinitionOutput.

func ExposeResourceDefinitions added in v0.4.0

func ExposeResourceDefinitions(_rds []*model.ResourceDefinition) []*model.ResourceDefinitionOutput

ExposeResourceDefinitions converts the ResourceDefinition slice to ResourceDefinitionOutput pointer slice.

func ExposeTemplateVersion added in v0.4.0

func ExposeTemplateVersion(_tv *model.TemplateVersion) *model.TemplateVersionOutput

ExposeTemplateVersion converts the TemplateVersion to TemplateVersionOutput.

func ExposeTemplateVersions added in v0.4.0

func ExposeTemplateVersions(_tvs []*model.TemplateVersion) []*model.TemplateVersionOutput

ExposeTemplateVersions converts the TemplateVersion slice to TemplateVersionOutput pointer slice.

func GetEnvironmentByID

func GetEnvironmentByID(ctx context.Context, mc model.ClientSet, id object.ID) (*model.Environment, error)

GetEnvironmentByID gets an environment including project & connectors edges by ID.

func GetEnvironmentsByIDs

func GetEnvironmentsByIDs(ctx context.Context, mc model.ClientSet, ids ...object.ID) ([]*model.Environment, error)

GetEnvironmentsByIDs gets environments including project & connectors edges by IDs.

func GetLatestRevisions

func GetLatestRevisions(
	ctx context.Context,
	modelClient model.ClientSet,
	resourceIDs ...object.ID,
) ([]*model.ResourceRevision, error)

func GetResourceDependantIDs added in v0.4.0

func GetResourceDependantIDs(ctx context.Context, mc model.ClientSet, resourceIDs ...object.ID) ([]object.ID, error)

GetResourceDependantIDs gets IDs of resources that depend on the given resources.

func GetResourceDependantNames added in v0.4.0

func GetResourceDependantNames(
	ctx context.Context,
	modelClient model.ClientSet,
	entity *model.Resource,
) ([]string, error)

GetResourceDependantNames gets names of resources that depends on the given resource.

func GetResourceNamesByIDs added in v0.4.0

func GetResourceNamesByIDs(
	ctx context.Context,
	modelClient model.ClientSet,
	resourceIDs ...object.ID,
) ([]string, error)

func ProjectSubjectRolesEdgeSave

func ProjectSubjectRolesEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Project) error

ProjectSubjectRolesEdgeSave saves the edge subject roles of model.Project entity.

func ResourceComponentGetUniqueKey added in v0.4.0

func ResourceComponentGetUniqueKey(r *model.ResourceComponent) string

ResourceComponentGetUniqueKey returns the unique index key of the given model.ResourceComponent.

func ResourceComponentInstancesEdgeSave added in v0.4.0

func ResourceComponentInstancesEdgeSave(
	ctx context.Context,
	mc model.ClientSet,
	entity *model.ResourceComponent,
) error

ResourceComponentInstancesEdgeSave saves the edge instances of model.ResourceComponent entity.

func ResourceComponentRelationshipUpdateWithDependencies added in v0.4.0

func ResourceComponentRelationshipUpdateWithDependencies(
	ctx context.Context,
	mc model.ClientSet,
	dependencies map[string][]string,
	recordResources,
	createResources model.ResourceComponents,
) error

ResourceComponentRelationshipUpdateWithDependencies updates the relationship with dependencies and resources.

func ResourceComponentShapeClassQuery added in v0.4.0

func ResourceComponentShapeClassQuery(query *model.ResourceComponentQuery) *model.ResourceComponentQuery

ResourceComponentShapeClassQuery wraps the given model.ResourceComponent query to select all shape class resources and the owned components and dependencies of them.

func ResourceComponentToMap added in v0.4.0

func ResourceComponentToMap(resources []*model.ResourceComponent) map[string]*model.ResourceComponent

ResourceComponentToMap recursive set a map of resource components indexed by its unique index.

func ResourceDefinitionMatchingRulesEdgeSave added in v0.4.0

func ResourceDefinitionMatchingRulesEdgeSave(
	ctx context.Context,
	mc model.ClientSet,
	entity *model.ResourceDefinition,
) error

ResourceDefinitionMatchingRulesEdgeSave saves the edge matching rules of model.ResourceDefinition entity.

func ResourceDependenciesEdgeSave added in v0.4.0

func ResourceDependenciesEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Resource) error

ResourceDependenciesEdgeSave saves the edge dependencies of model.Resource entity.

func ResourceRelationshipCheckCycle added in v0.4.0

func ResourceRelationshipCheckCycle(s *model.ResourceRelationship) bool

ResourceRelationshipCheckCycle checks if the path contains a dependency cycle.

func ResourceRelationshipGetDependencyNames added in v0.4.0

func ResourceRelationshipGetDependencyNames(entity *model.Resource) []string

ResourceRelationshipGetDependencyNames gets dependency resource names of the given resource.

func SubjectRolesEdgeSave

func SubjectRolesEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Subject) error

SubjectRolesEdgeSave saves the global scope edge roles of model.Subject entity, the roles must not have project id.

func WorkflowStageStepsEdgeSave added in v0.4.0

func WorkflowStageStepsEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.WorkflowStage) error

WorkflowStageStepsEdgeSave saves the edge steps of model.WorkflowStage entity.

func WorkflowStagesEdgeSave added in v0.4.0

func WorkflowStagesEdgeSave(ctx context.Context, mc model.ClientSet, entity *model.Workflow) error

Types

type CreateWorkflowExecutionOptions added in v0.4.0

type CreateWorkflowExecutionOptions struct {
	ExecuteOptions `json:",inline"`

	Workflow *model.Workflow
}

type CreateWorkflowStageExecutionOptions added in v0.4.0

type CreateWorkflowStageExecutionOptions struct {
	ExecuteOptions `json:",inline"`

	WorkflowExecution *model.WorkflowExecution
	Stage             *model.WorkflowStage
}

type CreateWorkflowStepExecutionOptions added in v0.4.0

type CreateWorkflowStepExecutionOptions struct {
	ExecuteOptions `json:",inline"`

	StageExecution *model.WorkflowStageExecution
	Step           *model.WorkflowStep
}

type ExecuteOptions

type ExecuteOptions struct {
	RestCfg *rest.Config
	Params  map[string]string
	// Description is the description of the workflow execution.
	Description string
}

Jump to

Keyboard shortcuts

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