models

package
v0.0.0-...-7d3b672 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateStructType

func GenerateStructType(schema utils.JsonObject, baseType reflect.Type) (reflect.Type, errors.Error)

func LoadTableModel

func LoadTableModel(tableName string, schema utils.JsonObject, parentModel any) (models.DynamicTabler, errors.Error)

func MapTo

func MapTo(x any, y any) errors.Error

func ToDatabaseMap

func ToDatabaseMap(tableName string, ifc any, createdAt *time.Time, updatedAt *time.Time) (map[string]any, errors.Error)

Types

type AddColumnOperation

type AddColumnOperation struct {
	Table      string         `json:"table"`
	Column     string         `json:"column"`
	ColumnType dal.ColumnType `json:"column_type"`
}

func (AddColumnOperation) Execute

func (o AddColumnOperation) Execute(dal dal.Dal) errors.Error

type ApiParams

type ApiParams struct {
	ConnectionId uint64
	ScopeId      string
}

type DropColumnOperation

type DropColumnOperation struct {
	Table  string `json:"table"`
	Column string `json:"column"`
}

func (DropColumnOperation) Execute

func (o DropColumnOperation) Execute(dal dal.Dal) errors.Error

type DropTableOperation

type DropTableOperation struct {
	Table  string `json:"table"`
	Column string `json:"column"`
}

func (DropTableOperation) Execute

func (o DropTableOperation) Execute(dal dal.Dal) errors.Error

type DynamicDomainScope

type DynamicDomainScope struct {
	TypeName string `json:"type_name"`
	Data     string `json:"data"`
}

func (DynamicDomainScope) Load

type DynamicModelInfo

type DynamicModelInfo struct {
	JsonSchema map[string]any `json:"json_schema" validate:"required"`
	TableName  string         `json:"table_name" validate:"required"`
}

func (DynamicModelInfo) LoadDynamicTabler

func (d DynamicModelInfo) LoadDynamicTabler(parentModel any) (models.DynamicTabler, errors.Error)

type DynamicScopeModel

type DynamicScopeModel struct {
	models.DynamicTabler
}

func NewDynamicScopeModel

func NewDynamicScopeModel(model models.DynamicTabler) *DynamicScopeModel

func (DynamicScopeModel) ConnectionId

func (d DynamicScopeModel) ConnectionId() uint64

func (*DynamicScopeModel) MarshalJSON

func (d *DynamicScopeModel) MarshalJSON() ([]byte, error)

func (DynamicScopeModel) ScopeId

func (d DynamicScopeModel) ScopeId() string

func (DynamicScopeModel) ScopeName

func (d DynamicScopeModel) ScopeName() string

func (DynamicScopeModel) ScopeParams

func (d DynamicScopeModel) ScopeParams() interface{}

func (*DynamicScopeModel) UnmarshalJSON

func (d *DynamicScopeModel) UnmarshalJSON(b []byte) error

type ExecuteOperation

type ExecuteOperation struct {
	Sql     string  `json:"sql"`
	Dialect *string `json:"dialect"`
}

func (ExecuteOperation) Execute

func (o ExecuteOperation) Execute(dal dal.Dal) errors.Error

type Operation

type Operation interface {
	Execute(dal.Dal) errors.Error
}

type PipelineData

type PipelineData struct {
	Plan   plugin.PipelinePlan  `json:"plan"`
	Scopes []DynamicDomainScope `json:"scopes"`
}

type PluginExtension

type PluginExtension string
const (
	None       PluginExtension = ""
	Metric     PluginExtension = "metric"
	Datasource PluginExtension = "datasource"
)

type PluginInfo

type PluginInfo struct {
	Name                 string                  `json:"name" validate:"required"`
	Description          string                  `json:"description"`
	ConnectionModelInfo  *DynamicModelInfo       `json:"connection_model_info" validate:"required"`
	ScopeConfigModelInfo *DynamicModelInfo       `json:"scope_config_model_info"`
	ScopeModelInfo       *DynamicModelInfo       `json:"scope_model_info" validate:"required"`
	ToolModelInfos       []*DynamicModelInfo     `json:"tool_model_infos"`
	MigrationScripts     []RemoteMigrationScript `json:"migration_scripts"`
	PluginPath           string                  `json:"plugin_path" validate:"required"`
	SubtaskMetas         []SubtaskMeta           `json:"subtask_metas"`
	Extension            PluginExtension         `json:"extension"`
}

type RemoteConnection

type RemoteConnection any

Type aliases used by the API helper for better readability

type RemoteMigrationScript

type RemoteMigrationScript struct {
	// contains filtered or unexported fields
}

func (*RemoteMigrationScript) Name

func (s *RemoteMigrationScript) Name() string

func (*RemoteMigrationScript) UnmarshalJSON

func (s *RemoteMigrationScript) UnmarshalJSON(data []byte) error

func (*RemoteMigrationScript) Up

func (*RemoteMigrationScript) Version

func (s *RemoteMigrationScript) Version() uint64

type RemotePlugin

RemotePlugin API supported by plugins running in different/remote processes

type RemoteScopeConfig

type RemoteScopeConfig any

Type aliases used by the API helper for better readability

type RenameTableOperation

type RenameTableOperation struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

func (RenameTableOperation) Execute

func (o RenameTableOperation) Execute(dal dal.Dal) errors.Error

type ScopeConfigModel

type ScopeConfigModel struct {
	common.ScopeConfig `mapstructure:",squash"`
	ConnectionId       uint64 `json:"connectionId"`
	Name               string `json:"name"`
}

type ScopeModel

type ScopeModel struct {
	common.NoPKModel `swaggerignore:"true"`
	Id               string `gorm:"primarykey;type:varchar(255)" json:"id"`
	ConnectionId     uint64 `gorm:"primaryKey" json:"connectionId"`
	Name             string `json:"name" validate:"required"`
	ScopeConfigId    uint64 `json:"scopeConfigId"`
}

type SubtaskMeta

type SubtaskMeta struct {
	Name             string   `json:"name" validate:"required"`
	EntryPointName   string   `json:"entry_point_name" validate:"required"`
	Arguments        []string `json:"arguments"`
	Required         bool     `json:"required"`
	EnabledByDefault bool     `json:"enabled_by_default"`
	Description      string   `json:"description" validate:"required"`
	DomainTypes      []string `json:"domain_types" validate:"required"`
}

Jump to

Keyboard shortcuts

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