datamodel

package
v0.2.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DstConnDefJSONSchema *jsonschema.Schema

DstConnDefJSONSchema represents the ConnectorDefinition JSON Schema for validating the payload

View Source
var DstConnJSONSchema *jsonschema.Schema

DstConnJSONSchema represents the Connector JSON Schema for validating the payload

View Source
var SrcConnDefJSONSchema *jsonschema.Schema

SrcConnDefJSONSchema represents the ConnectorDefinition JSON Schema for validating the payload

View Source
var SrcConnJSONSchema *jsonschema.Schema

SrcConnJSONSchema represents the Connector JSON Schema for validating the payload

Functions

func InitJSONSchema

func InitJSONSchema()

InitJSONSchema initialise JSON Schema instances with the given files

func ValidateJSONSchema

func ValidateJSONSchema(schema *jsonschema.Schema, msg interface{}, emitUnpopulated bool) error

ValidateJSONSchema validates the Protobuf message data

func ValidateJSONSchemaString

func ValidateJSONSchemaString(schema string, data string) error

ValidateJSONSchemaString validates the string data given a string schema

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 BaseStatic

type BaseStatic 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"`
}

BaseStatic contains common columns for all tables with static UUID as primary key

type ConnectionType

type ConnectionType connectorPB.ConnectionType

ConnectionType is an alias type for Protobuf enum ConnectionType

func (*ConnectionType) Scan

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

Scan function for custom GORM type ConnectionType

func (ConnectionType) Value

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

Value function for custom GORM type ConnectionType

type Connector

type Connector struct {
	BaseDynamic
	ID                     string
	Owner                  string
	ConnectorDefinitionUID uuid.UUID
	Description            sql.NullString
	Tombstone              bool
	Configuration          datatypes.JSON `gorm:"type:jsonb"`
	ConnectorType          ConnectorType  `sql:"type:valid_connector_type"`
}

Connector is the data model of the connector table

type ConnectorDefinition

type ConnectorDefinition struct {
	BaseStatic
	ID                   string
	Title                string
	DockerRepository     string
	DockerImageTag       string
	DocumentationURL     string
	Icon                 string
	Tombstone            bool
	Public               bool
	Custom               bool
	ReleaseDate          *time.Time
	Spec                 datatypes.JSON `gorm:"type:jsonb"`
	ResourceRequirements datatypes.JSON `gorm:"type:jsonb"`
	ConnectorType        ConnectorType  `sql:"type:valid_connector_type"`
	ConnectionType       ConnectionType `sql:"type:valid_connection_type"`
	ReleaseStage         ReleaseStage   `sql:"type:valid_release_stage"`
}

ConnectorDefinition is the data model of the connector_definition table

type ConnectorType

type ConnectorType connectorPB.ConnectorType

ConnectorType is an alias type for Protobuf enum ConnectorType

func (*ConnectorType) Scan

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

Scan function for custom GORM type ConnectorType

func (ConnectorType) Value

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

Value function for custom GORM type ConnectorType

type ReleaseStage

type ReleaseStage connectorPB.ReleaseStage

ReleaseStage is an alias type for Protobuf enum ReleaseStage

func (*ReleaseStage) Scan

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

Scan function for custom GORM type ReleaseStage

func (ReleaseStage) Value

func (r ReleaseStage) Value() (driver.Value, error)

Value function for custom GORM type ReleaseStage

Jump to

Keyboard shortcuts

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