core

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgDML MsgType = "dml"
	MsgDDL MsgType = "ddl"
	MsgCtl MsgType = "ctl"

	InsertAction  ActionType = "insert"
	UpdateAction  ActionType = "update"
	DeleteAction  ActionType = "delete"
	ReplaceAction ActionType = "replace"

	CreateAction   DDLActionType = "create"
	AlterAction    DDLActionType = "alter"
	RenameAction   DDLActionType = "rename"
	DropAction     DDLActionType = "drop"
	TruncateAction DDLActionType = "Truncate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string

type DDLActionType added in v0.0.2

type DDLActionType string

type DDLMsg added in v0.0.2

type DDLMsg struct {
	Action       DDLActionType
	NewTable     metas.Table
	DdlStatement metas.DdlStatement
}

type DMLMsg

type DMLMsg struct {
	Action       ActionType
	Data         map[string]interface{}
	Old          map[string]interface{}
	TableVersion uint
}

type Input

type Input interface {
	NewInput(metas *Metas)
	Start(pos Position, in chan *Msg)
	Close()
}

type InputMeta added in v0.3.0

type InputMeta interface {
	LoadMeta(routers []*metas.Router) error
	GetMeta(*metas.Router) (*metas.Table, error)
	// GetAll() map[string]*metas.Table
	GetVersion(schema string, tableName string, version uint) (*metas.Table, error)
	// Add(*metas.Table) error
	// Update(newTable *metas.Table) error
	// Delete(string, string) error
	Save() error
	Close()
}

type Metas

type Metas struct {
	Input   InputMeta
	Output  OutputMeta
	Routers *metas.Routers
}

func (*Metas) InitRouterColumnsMapper added in v0.0.2

func (m *Metas) InitRouterColumnsMapper() error

func (*Metas) InitRouterColumnsMapperMapMapper added in v0.0.2

func (m *Metas) InitRouterColumnsMapperMapMapper()

type Msg

type Msg struct {
	Database     string
	Table        string
	Type         MsgType
	DmlMsg       *DMLMsg
	Timestamp    time.Time
	InputContext struct {
		Pos string
	}
}

func (*Msg) ToString

func (m *Msg) ToString() string

type MsgType

type MsgType string

type Output

type Output interface {
	NewOutput(metas *Metas)
	Start(out chan *Msg, pos Position)
	Close()
}

type OutputMeta added in v0.3.0

type OutputMeta interface {
	LoadMeta(routers []*metas.Router) error
	GetMeta(*metas.Router) (interface{}, error)
	// GetAll() map[string]*metas.Table
	// GetVersion(schema string, tableName string, version uint) (*metas.Table, error)
	// Add(*metas.Table) error
	// Update(newTable *metas.Table) error
	// Delete(string, string) error
	Save() error
	Close()
}

type Position

type Position interface {
	LoadPosition(name string) string
	Start()
	Update(v string) error
	Save() error
	Get() string
	Close()
}

type Transform

type Transform interface {
	NewTransform(config map[string]interface{}) error
	Transform(msg *Msg) bool
}

Jump to

Keyboard shortcuts

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