models

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 19 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(basicRes context.BasicRes) errors.Error

type ApiParams

type ApiParams struct {
	ConnectionId uint64
	ScopeId      string
}

type CreateTableOperation

type CreateTableOperation struct {
	ModelInfo *DynamicModelInfo `json:"model_info"`
}

func (CreateTableOperation) Execute

func (o CreateTableOperation) Execute(basicRes context.BasicRes) errors.Error

type DropColumnOperation

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

func (DropColumnOperation) Execute

func (o DropColumnOperation) Execute(basicRes context.BasicRes) errors.Error

type DropTableOperation

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

func (DropTableOperation) Execute

func (o DropTableOperation) Execute(basicRes context.BasicRes) 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) ScopeConnectionId

func (d DynamicScopeModel) ScopeConnectionId() uint64

ScopeConnectionId implements plugin.ToolLayerScope.

func (DynamicScopeModel) ScopeFullName

func (d DynamicScopeModel) ScopeFullName() string

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) ScopeScopeConfigId

func (d DynamicScopeModel) ScopeScopeConfigId() uint64

ScopeScopeConfigId implements plugin.ToolLayerScope.

func (*DynamicScopeModel) UnmarshalJSON

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

type ExecuteOperation

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

func (ExecuteOperation) Execute

func (o ExecuteOperation) Execute(basicRes context.BasicRes) errors.Error

type Operation

type Operation interface {
	Execute(basicRes context.BasicRes) errors.Error
}

type PipelineData

type PipelineData struct {
	Plan   models.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 RenameColumnOperation

type RenameColumnOperation struct {
	Table   string `json:"table"`
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

func (RenameColumnOperation) Execute

func (o RenameColumnOperation) Execute(basicRes context.BasicRes) errors.Error

type RenameTableOperation

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

func (RenameTableOperation) Execute

func (o RenameTableOperation) Execute(basicRes context.BasicRes) 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"`
}

type ToolModel

type ToolModel struct {
	common.NoPKModel
	ConnectionId uint64 `json:"connectionId" gorm:"column:connection_id;not null"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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