models

package
v0.0.0-...-5b6efc0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8scontainer    ImplementationType = "k8scontainer"
	BrickType       ComponentType      = `brick`
	AnyType         ComponentType      = `any`
	GraphType       ComponentType      = `graph`
	MapType         ComponentType      = `map`
	ConditionalType ComponentType      = `conditional`
	ArgSrcPort      string             = `port`
	ArgSrcFile      string             = `file`
	WorkflowType    string             = `workflow`

	FlowifyArtifactType       string = "artifact"
	FlowifyParameterType      string = "parameter"
	FlowifySecretType         string = "env_secret"
	FlowifyParameterArrayType string = "parameter_array"
	FlowifyVolumeType         string = "volume"

	VersionInit      VersionNumber = VersionNumber(1)
	VersionTagLatest string        = "latest"
)

Variables

View Source
var (
	//go:embed spec/*
	StaticSpec        embed.FS
	RegisteredSchemas map[reflect.Type]*jsonschema.Schema
)
View Source
var (
	ErrNoSchemaFound = fmt.Errorf("no schema found")
)

Functions

func FindSchema

func FindSchema(nameOrPath string) *jsonschema.Schema

func Validate

func Validate(data []byte, schemaFilePath string) error

func ValidateDocument

func ValidateDocument(document []byte, t reflect.Type) error

func WorkspacesInputToCreateData

func WorkspacesInputToCreateData(input workspace.InputData, namespace string) workspace.Data

func WorkspacesInputToUpdateData

func WorkspacesInputToUpdateData(input workspace.InputData, namespace string) workspace.Data

Types

type Any

type Any struct {
	ImplementationBase `json:",inline" bson:",inline"`
}

type Argument

type Argument struct {
	ArgumentBase `json:",inline" bson:",inline"`
	Source       interface{} `json:"source" bson:"source"`
}

func (*Argument) UnmarshalBSON

func (arg *Argument) UnmarshalBSON(data []byte) error

func (*Argument) UnmarshalJSON

func (a *Argument) UnmarshalJSON(document []byte) error

type ArgumentBase

type ArgumentBase struct {
	Description string         `json:"description,omitempty" bson:"description,omitempty"`
	Target      ArgumentTarget `json:"target,omitempty" bson:"target,omitempty"`
}

type ArgumentSourceFile

type ArgumentSourceFile struct {
	File string `json:"file" bson:"file"`
}

type ArgumentSourcePort

type ArgumentSourcePort struct {
	Port string `json:"port" bson:"port"`
}

type ArgumentTarget

type ArgumentTarget struct {
	Type   string `json:"type" bson:"type"`
	Prefix string `json:"prefix,omitempty" bson:"prefix,omitempty"`
	Suffix string `json:"suffix,omitempty" bson:"suffix,omitempty"`
}

type Brick

type Brick struct {
	ImplementationBase `json:",inline" bson:",inline"`
	Container          *corev1.Container `json:"container"`
	Args               []Argument        `json:"args,omitempty" bson:"args"`
	Results            []Result          `json:"results,omitempty" bson:"results"`
}

type CRefVersion

type CRefVersion struct {
	Version VersionNumber      `json:"version,omitempty" bson:"version,omitempty"`
	Uid     ComponentReference `json:"uid,omitempty" bson:"uid,omitempty"`
}

func (CRefVersion) IsZero

func (c CRefVersion) IsZero() bool

func (CRefVersion) String

func (c CRefVersion) String() string

type Component

type Component struct {
	ComponentBase  `json:",inline" bson:",inline"`
	Implementation interface{} `json:"implementation"`
}

func (*Component) UnmarshalBSON

func (c *Component) UnmarshalBSON(data []byte) error

func (*Component) UnmarshalJSON

func (c *Component) UnmarshalJSON(document []byte) error

implements the json.Unmarshaler (cf. https://pkg.go.dev/encoding/json#Unmarshaler)

type ComponentBase

type ComponentBase struct {
	Metadata `json:",inline" bson:",inline"`
	Inputs   []Data        `json:"inputs,omitempty"`
	Outputs  []Data        `json:"outputs,omitempty"`
	Type     ComponentType `json:"type"`
}

type ComponentPostOptions

type ComponentPostOptions struct {
}

type ComponentPostRequest

type ComponentPostRequest struct {
	Component Component            `json:"component"`
	Options   ComponentPostOptions `json:"options,omitempty"`
}

type ComponentReference

type ComponentReference uuid.UUID

func NewComponentReference

func NewComponentReference() ComponentReference

func NewReference

func NewReference(s string) ComponentReference

Uses MustParse. Only use for testing

func (*ComponentReference) IsZero

func (id *ComponentReference) IsZero() bool

func (ComponentReference) MarshalBSONValue

func (c ComponentReference) MarshalBSONValue() (bsontype.Type, []byte, error)

func (ComponentReference) MarshalJSON

func (r ComponentReference) MarshalJSON() ([]byte, error)

func (ComponentReference) String

func (r ComponentReference) String() string

func (*ComponentReference) UnmarshalBSONValue

func (c *ComponentReference) UnmarshalBSONValue(t bsontype.Type, data []byte) error

func (*ComponentReference) UnmarshalJSON

func (r *ComponentReference) UnmarshalJSON(data []byte) error

type ComponentType

type ComponentType string

type Conditional

type Conditional struct {
	ImplementationBase `json:",inline" bson:",inline"`
	Expression         `json:"expression" bson:"expression"`
	NodeTrue           interface{} `json:"nodeTrue" bson:"nodeTrue"`
	NodeFalse          interface{} `json:"nodeFalse,omitempty" bson:"nodeFalse,omitempty"`
	InputMappings      []Edge      `json:"inputMappings,omitempty" bson:"inputMappings,omitempty"`
	OutputMappings     []Edge      `json:"outputMappings,omitempty" bson:"outputMappings,omitempty"`
}

func (*Conditional) UnmarshalBSON

func (c *Conditional) UnmarshalBSON(data []byte) error

func (*Conditional) UnmarshalJSON

func (c *Conditional) UnmarshalJSON(document []byte) error

type Data

type Data struct {
	Name      string   `json:"name"`
	MediaType []string `json:"mediatype,omitempty"`
	Type      string   `json:"type"`
	// opaque userdata never touched by the backend
	Userdata json.RawMessage `json:"userdata,omitempty"`
}

type Edge

type Edge struct {
	Source PortAddress `json:"source"`
	Target PortAddress `json:"target"`
}

type Expression

type Expression struct {
	Left     interface{} `json:"left" bson:"left"`
	Right    interface{} `json:"right" bson:"right"`
	Operator string      `json:"operator" bson:"operator"`
}

func (*Expression) UnmarshalBSON

func (e *Expression) UnmarshalBSON(data []byte) error

func (*Expression) UnmarshalJSON

func (e *Expression) UnmarshalJSON(document []byte) error

func (Expression) Validate

func (e Expression) Validate(doc []byte) error

type FileResultSource

type FileResultSource struct {
	File string `json:"file" bson:"file"`
}

type FlowifyVolume

type FlowifyVolume struct {
	Uid       ComponentReference `json:"uid"`
	Workspace string             `json:"workspace"`
	Volume    corev1.Volume      `json:"volume"`
}

type FlowifyVolumeList

type FlowifyVolumeList struct {
	Items    []FlowifyVolume `json:"items"`
	PageInfo PageInfo        `json:"pageInfo"`
}

type Graph

type Graph struct {
	ImplementationBase `json:",inline" bson:",inline"`
	Nodes              []Node `json:"nodes,omitempty" bson:"nodes"`
	Edges              []Edge `json:"edges,omitempty" bson:"edges"`
	InputMappings      []Edge `json:"inputMappings,omitempty" bson:"inputMappings,omitempty"`
	OutputMappings     []Edge `json:"outputMappings,omitempty" bson:"outputMappings,omitempty"`
}

type ImplementationBase

type ImplementationBase struct {
	Type ComponentType `json:"type" bson:"type"`
}

type ImplementationType

type ImplementationType string

type Job

type Job struct {
	Metadata `json:",inline" bson:",inline"`
	// the workflow is either a workflow or a reference to one in the database
	Type        ComponentType `json:"type" bson:"type"`
	InputValues []Value       `json:"inputValues,omitempty" bson:"inputValues,omitempty"`
	Workflow    Workflow      `json:"workflow" bson:"workflow"`
	Events      []JobEvent    `json:"events,omitempty" bson:"events,omitempty"`
}

type JobEvent

type JobEvent wfv1.Workflow

type JobPostOptions

type JobPostOptions struct {
	Constants []interface{} `json:"constants"`
	Tags      []string      `json:"tags"`
}

type JobPostRequest

type JobPostRequest struct {
	Job           Job            `json:"job"`
	SubmitOptions JobPostOptions `json:"options"`
}

type JobStatus

type JobStatus struct {
	Uid    ComponentReference `json:"uid" bson:"uid"`
	Status wfv1.WorkflowPhase `json:"status" bson:"status"`
}

type Map

type Map struct {
	ImplementationBase `json:",inline" bson:",inline"`
	Node               interface{} `json:"node" bson:"node"`
	InputMappings      []Edge      `json:"inputMappings,omitempty" bson:"inputMappings,omitempty"`
	OutputMappings     []Edge      `json:"outputMappings,omitempty" bson:"outputMappings,omitempty"`
}

func (*Map) UnmarshalBSON

func (m *Map) UnmarshalBSON(data []byte) error

func (*Map) UnmarshalJSON

func (m *Map) UnmarshalJSON(document []byte) error

type Metadata

type Metadata struct {
	/* ModifiedBy, Uid and Timestamp are client read-only */
	Name        string             `json:"name,omitempty" bson:"name,omitempty"`
	Description string             `json:"description,omitempty" bson:"description,omitempty"`
	ModifiedBy  ModifiedBy         `json:"modifiedBy,omitempty" bson:"modifiedBy,omitempty"`
	Uid         ComponentReference `json:"uid,omitempty" bson:"uid,omitempty"`
	Version     Version            `json:"version,omitempty" bson:"version,omitempty"`
	Timestamp   time.Time          `json:"timestamp" bson:"timestamp"`
}

type MetadataList

type MetadataList struct {
	Items []Metadata `json:"items,omitempty"`
	// Total number in query before pagination,
	PageInfo PageInfo `json:"pageInfo"`
}

type MetadataWorkspace

type MetadataWorkspace struct {
	// Metadata with with Workspace
	Metadata  `json:",inline" bson:",inline"`
	Workspace string `json:"workspace" bson:"workspace"`
}

type MetadataWorkspaceList

type MetadataWorkspaceList struct {
	Items []MetadataWorkspace `json:"items,omitempty"`
	// Total number in query before pagination,
	PageInfo PageInfo `json:"pageInfo"`
}

type ModifiedBy

type ModifiedBy struct {
	Oid   string `json:"oid" bson:"oid"`
	Email string `json:"email,omitempty" bson:"email,omitempty"`
}

type Node

type Node struct {
	Id   string      `json:"id" bson:"id"`
	Node interface{} `json:"node" bson:"node"`
	// the node has userdata which is never touched by the backend
	Userdata json.RawMessage `json:"userdata,omitempty" bson:"userdata,omitempty"`
}

func (*Node) UnmarshalBSON

func (n *Node) UnmarshalBSON(data []byte) error

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(document []byte) error

implements the json.Unmarshaler (cf. https://pkg.go.dev/encoding/json#Unmarshaler)

func (Node) Validate

func (n Node) Validate(doc []byte) error

type PageInfo

type PageInfo struct {
	TotalNumber int `json:"totalNumber"`
	Limit       int `json:"limit"`
	Skip        int `json:"skip"`
}

type PortAddress

type PortAddress struct {
	Node string `json:"node,omitempty" bson:"node,omitempty"`
	Port string `json:"port" bson:"port"`
}

type Result

type Result struct {
	ResultBase `json:",inline" bson:",inline"`
	Source     interface{} `json:"source" bson:"source"`
}

func (*Result) UnmarshalBSON

func (res *Result) UnmarshalBSON(data []byte) error

func (*Result) UnmarshalJSON

func (res *Result) UnmarshalJSON(document []byte) error

implements the json.Unmarshaler (cf. https://pkg.go.dev/encoding/json#Unmarshaler)

type ResultBase

type ResultBase struct {
	Description string      `json:"description,omitempty" bson:"description,omitempty"`
	Target      PortAddress `json:"target,omitempty" bson:"target"`
}

type SourceTxt

type SourceTxt string

func (SourceTxt) MarshalBSONValue

func (a SourceTxt) MarshalBSONValue() (bsontype.Type, []byte, error)

func (*SourceTxt) UnmarshalBSONValue

func (a *SourceTxt) UnmarshalBSONValue(t bsontype.Type, data []byte) error

type Value

type Value struct {
	Value  interface{} `json:"value" bson:"value"`
	Target string      `json:"target" bson:"target"`
}

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(document []byte) error

type Version

type Version struct {
	Current  VersionNumber `json:"current" bson:"current"`
	Tags     []string      `json:"tags,omitempty" bson:"tags,omitempty"`
	Previous CRefVersion   `json:"previous,omitempty" bson:"previous,omitempty"`
}

func (*Version) InitializeNew

func (v *Version) InitializeNew() error

func (*Version) SetLatestTag

func (v *Version) SetLatestTag()

func (*Version) SetTag

func (v *Version) SetTag(tag string)

type VersionNumber

type VersionNumber int

func (VersionNumber) String

func (v VersionNumber) String() string

type VolumeResultSource

type VolumeResultSource struct {
	Volume string `json:"volume" bson:"volume"`
}

type Workflow

type Workflow struct {
	Metadata  `json:",inline" bson:",inline"`
	Component Component     `json:"component" bson:"component"`
	Type      ComponentType `json:"type" bson:"type"`
	Workspace string        `json:"workspace" bson:"workspace"`
}

type WorkflowPostRequest

type WorkflowPostRequest struct {
	Workflow Workflow             `json:"workflow"`
	Options  ComponentPostOptions `json:"options,omitempty"`
}

Jump to

Keyboard shortcuts

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