Documentation ¶
Index ¶
- Constants
- Variables
- type ColumnType
- type MongoTables
- func (mts *MongoTables) AddTable(db string, table string) (*Table, error)
- func (mts *MongoTables) AddTableForMsg(msg *msg.Msg) error
- func (mts *MongoTables) Close()
- func (mts *MongoTables) Configure(pipelineName string, configInput map[string]interface{}) error
- func (mts *MongoTables) DelTable(db string, table string) error
- func (mts *MongoTables) GetTable(db string, table string) (*Table, error)
- func (mts *MongoTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig map[string]interface{}, startPos string, ...)
- func (mts *MongoTables) RefreshTable(db string, table string)
- func (mts *MongoTables) SaveMeta(data string) error
- func (mts *MongoTables) UpdateTable(db string, table string, args interface{}, pos string, index int) (err error)
- type MysqlTables
- func (mts *MysqlTables) AddTable(db string, table string) (*Table, error)
- func (mts *MysqlTables) AddTableForMsg(msg *msg.Msg) error
- func (mts *MysqlTables) Close()
- func (mts *MysqlTables) Configure(pipelineName string, configInput map[string]interface{}) error
- func (mts *MysqlTables) DelTable(db string, table string) (err error)
- func (mts *MysqlTables) ExecuteSQL(cmd string, args ...interface{}) (rr *mysql.Result, err error)
- func (mts *MysqlTables) ExecuteSQLForMemDB(cmd string, args ...interface{}) (rr *mysql.Result, err error)
- func (mts *MysqlTables) ExecuteSQLForMetaDB(cmd string, args ...interface{}) (rr *mysql.Result, err error)
- func (mts *MysqlTables) GetColumnTypeFromRawType(rawType string) int
- func (mts *MysqlTables) GetTable(db string, table string) (*Table, error)
- func (mts *MysqlTables) GetTableCreateDDL(db string, table string) (string, error)
- func (mts *MysqlTables) LoadMetaFromDB(rulesMap map[string]interface{}) map[string]interface{}
- func (mts *MysqlTables) LoadSyncTableMetaFromDB() map[string]interface{}
- func (mts *MysqlTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig map[string]interface{}, startPos string, ...)
- func (mts *MysqlTables) RefreshTable(db string, table string)
- func (mts *MysqlTables) SaveMeta(tablesMeta string) error
- func (mts *MysqlTables) StartTimerSaveMeta()
- func (mts *MysqlTables) UpdateTable(db string, table string, ddl interface{}, pos string, index int) (err error)
- type MysqlTablesMeta
- type Table
- type TableColumn
Constants ¶
View Source
const MongoName = "mongo"
View Source
const MysqlName = "mysql"
Variables ¶
View Source
var MemDbHost = "localhost"
View Source
var MemDbPort = 5166 // default 5166
Functions ¶
This section is empty.
Types ¶
type ColumnType ¶
type ColumnType = int
const ( TypeNumber ColumnType = iota + 1 // tinyint, smallint, int, bigint, year TypeMediumInt // medium int TypeFloat // float, double TypeEnum // enum TypeSet // set TypeString // other TypeDatetime // datetime TypeTimestamp // timestamp TypeDate // date TypeTime // time TypeBit // bit TypeJson // json TypeDecimal // decimal )
type MongoTables ¶
type MongoTables struct { *config.MongoConfig // contains filtered or unexported fields }
func (*MongoTables) AddTable ¶
func (mts *MongoTables) AddTable(db string, table string) (*Table, error)
func (*MongoTables) AddTableForMsg ¶
func (mts *MongoTables) AddTableForMsg(msg *msg.Msg) error
func (*MongoTables) Close ¶
func (mts *MongoTables) Close()
func (*MongoTables) Configure ¶ added in v0.5.0
func (mts *MongoTables) Configure(pipelineName string, configInput map[string]interface{}) error
func (*MongoTables) DelTable ¶ added in v0.4.1
func (mts *MongoTables) DelTable(db string, table string) error
func (*MongoTables) GetTable ¶
func (mts *MongoTables) GetTable(db string, table string) (*Table, error)
func (*MongoTables) NewSchemaTables ¶
func (mts *MongoTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig map[string]interface{}, startPos string, rulesMap map[string]interface{})
func (*MongoTables) RefreshTable ¶
func (mts *MongoTables) RefreshTable(db string, table string)
func (*MongoTables) SaveMeta ¶ added in v0.3.3
func (mts *MongoTables) SaveMeta(data string) error
func (*MongoTables) UpdateTable ¶
type MysqlTables ¶
type MysqlTables struct { sync.RWMutex *config.MysqlConfig *MysqlTablesMeta FilePath string // contains filtered or unexported fields }
func (*MysqlTables) AddTable ¶
func (mts *MysqlTables) AddTable(db string, table string) (*Table, error)
func (*MysqlTables) AddTableForMsg ¶
func (mts *MysqlTables) AddTableForMsg(msg *msg.Msg) error
func (*MysqlTables) Close ¶
func (mts *MysqlTables) Close()
func (*MysqlTables) Configure ¶ added in v0.5.0
func (mts *MysqlTables) Configure(pipelineName string, configInput map[string]interface{}) error
func (*MysqlTables) DelTable ¶ added in v0.4.1
func (mts *MysqlTables) DelTable(db string, table string) (err error)
func (*MysqlTables) ExecuteSQL ¶
func (mts *MysqlTables) ExecuteSQL(cmd string, args ...interface{}) (rr *mysql.Result, err error)
func (*MysqlTables) ExecuteSQLForMemDB ¶ added in v0.5.0
func (mts *MysqlTables) ExecuteSQLForMemDB(cmd string, args ...interface{}) (rr *mysql.Result, err error)
func (*MysqlTables) ExecuteSQLForMetaDB ¶ added in v0.5.0
func (mts *MysqlTables) ExecuteSQLForMetaDB(cmd string, args ...interface{}) (rr *mysql.Result, err error)
func (*MysqlTables) GetColumnTypeFromRawType ¶
func (mts *MysqlTables) GetColumnTypeFromRawType(rawType string) int
func (*MysqlTables) GetTable ¶
func (mts *MysqlTables) GetTable(db string, table string) (*Table, error)
func (*MysqlTables) GetTableCreateDDL ¶ added in v0.5.0
func (mts *MysqlTables) GetTableCreateDDL(db string, table string) (string, error)
func (*MysqlTables) LoadMetaFromDB ¶
func (mts *MysqlTables) LoadMetaFromDB(rulesMap map[string]interface{}) map[string]interface{}
func (*MysqlTables) LoadSyncTableMetaFromDB ¶ added in v0.5.0
func (mts *MysqlTables) LoadSyncTableMetaFromDB() map[string]interface{}
func (*MysqlTables) NewSchemaTables ¶
func (mts *MysqlTables) NewSchemaTables(conf *config.BaseConfig, pluginConfig map[string]interface{}, startPos string, rulesMap map[string]interface{})
func (*MysqlTables) RefreshTable ¶
func (mts *MysqlTables) RefreshTable(db string, table string)
func (*MysqlTables) SaveMeta ¶
func (mts *MysqlTables) SaveMeta(tablesMeta string) error
func (*MysqlTables) StartTimerSaveMeta ¶ added in v0.5.0
func (mts *MysqlTables) StartTimerSaveMeta()
func (*MysqlTables) UpdateTable ¶
type MysqlTablesMeta ¶
type MysqlTablesMeta struct {
// contains filtered or unexported fields
}
type Table ¶
type Table struct { Schema string `toml:"schema" json:"schema"` Name string `toml:"name" json:"name"` Columns []TableColumn `toml:"columns" json:"columns"` }
func (*Table) FindColumn ¶
func (*Table) GetTableColumnsName ¶
type TableColumn ¶
type TableColumn struct { Name string `toml:"name" json:"name"` Type ColumnType `toml:"type" json:"type"` RawType string `toml:"raw_type" json:"raw_type"` }
Click to show internal directories.
Click to hide internal directories.