datamodel

package
v0.5.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PipelineJSONSchema *jsonschema.Schema

PipelineJSONSchema represents the Pipeline JSON Schema for validating the payload

Functions

func InitJSONSchema

func InitJSONSchema()

InitJSONSchema initialise JSON Schema instances with the given files

func ValidatePipelineJSONSchema

func ValidatePipelineJSONSchema(pbPipeline *pipelinePB.Pipeline) error

ValidatePipelineJSONSchema validates the Protobuf message data

Types

type BaseDynamic

type BaseDynamic struct {
	UID        uuid.UUID      `gorm:"type:uuid;primary_key;<-:create"` // allow read and create
	CreateTime time.Time      `gorm:"autoCreateTime:nano"`
	UpdateTime time.Time      `gorm:"autoUpdateTime:nano"`
	DeleteTime gorm.DeletedAt `sql:"index"`
}

BaseDynamic contains common columns for all tables with dynamic UUID as primary key generated when creating

func (*BaseDynamic) BeforeCreate

func (base *BaseDynamic) BeforeCreate(db *gorm.DB) error

BeforeCreate will set a UUID rather than numeric ID.

type Error

type Error struct {
	Status int32 `json:"status,omitempty"`

	Title string `json:"title,omitempty"`

	Detail string `json:"detail,omitempty"`
}

type Logic

type Logic struct {
}

Logic is the data model of logic operator

type Pipeline

type Pipeline struct {
	BaseDynamic
	ID          string
	Owner       string
	Description sql.NullString
	Mode        PipelineMode
	State       PipelineState
	Recipe      *Recipe `gorm:"type:jsonb"`
}

Pipeline is the data model of the pipeline table

type PipelineMode

type PipelineMode pipelinePB.Pipeline_Mode

PipelineMode is an alias type for Protobuf enum Pipeline.Mode

func (*PipelineMode) Scan

func (c *PipelineMode) Scan(value interface{}) error

Scan function for custom GORM type PipelineMode

func (PipelineMode) Value

func (c PipelineMode) Value() (driver.Value, error)

Value function for custom GORM type PipelineMode

type PipelineState

type PipelineState pipelinePB.Pipeline_State

PipelineState is an alias type for Protobuf enum Pipeline.State

func (*PipelineState) Scan

func (c *PipelineState) Scan(value interface{}) error

Scan function for custom GORM type PipelineState

func (PipelineState) Value

func (c PipelineState) Value() (driver.Value, error)

Value function for custom GORM type PipelineState

type Recipe

type Recipe struct {
	Source         string   `json:"source,omitempty"`
	Destination    string   `json:"destination,omitempty"`
	ModelInstances []string `json:"model_instances,omitempty"`
	Logics         []string `json:"logics,omitempty"`
}

Recipe is the data model of the pipeline recipe

func (*Recipe) Scan

func (r *Recipe) Scan(value interface{}) error

Scan function for custom GORM type Recipe

func (*Recipe) Value

func (r *Recipe) Value() (driver.Value, error)

Value function for custom GORM type Recipe

Jump to

Keyboard shortcuts

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