db

package
v0.0.0-...-387885d Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB() *gorm.DB

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}
var DB Database

func (*Database) Connect

func (db *Database) Connect()

func (*Database) GetDBObj

func (db *Database) GetDBObj() *gorm.DB

func (*Database) Migrate

func (db *Database) Migrate()

type FlowModel

type FlowModel struct {
	gorm.Model
	ID               globals.UID `gorm:"primaryKey;not null;autoIncrement:true"`
	Name             string
	StartNodeID      globals.UID
	IsOSThreadNeeded bool
	ConfigJSON       string
}

type LinkModel

type LinkModel struct {
	gorm.Model
	ID globals.UID `gorm:"primaryKey;not null;autoIncrement:true"`
	// MidPoint Position
	StartPortID      globals.UID
	EndPortID        globals.UID
	WaitSettingsJson string
	ParentPortUID    globals.UID // foreignKey for PortModel
}

type NodeModel

type NodeModel struct {
	gorm.Model
	ID           globals.UID `gorm:"primaryKey;not null;autoIncrement:true"`
	NType        NodeType
	ParentFlowID globals.UID
	// Pos Position
	Ports []PortModel `gorm:"foreignKey:ParentNodeUID"`
}

type NodeType

type NodeType string

type PortDirection

type PortDirection int
const (
	InputDir PortDirection = iota
	OutputDir
)

type PortModel

type PortModel struct {
	gorm.Model
	ID           globals.UID `gorm:"primaryKey;not null;autoIncrement:true"`
	PDir         PortDirection
	PType        PortType
	ParentNodeID globals.UID
	Label        string
	// Pos Position
	CLinks        []LinkModel `gorm:"foreignKey:ParentPortUID"`
	IsVirtual     bool
	Alias         string
	ParentNodeUID globals.UID // foreignKey for NodeModel
}

type PortType

type PortType int
const (
	QueryPort PortType = iota // type: input, ends: getPort
	RunPort                   // type: input, starts: callPort
	SetPort                   // type: input, starts: sendPort
	GetPort                   // type: output, starts: queryPort
	SendPort                  // type: output, ends: setPort
	CallPort                  // type: output, ends: runPort
)

func PortFromStr

func PortFromStr(pTypeStr string) PortType

func (PortType) Str

func (pt PortType) Str() string

Jump to

Keyboard shortcuts

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