Documentation ¶
Index ¶
- type AnalyzeResult
- type CheckResult
- type CommonResult
- type Config
- type DBConfig
- type DMTaskConfig
- type GenerateConfigResult
- type Handler
- func (p *Handler) AnalyzeConfig(w http.ResponseWriter, req *http.Request)
- func (p *Handler) Check(w http.ResponseWriter, req *http.Request)
- func (p *Handler) Download(w http.ResponseWriter, req *http.Request)
- func (p *Handler) GenerateConfig(w http.ResponseWriter, req *http.Request)
- func (p *Handler) GetSchemaInfo(w http.ResponseWriter, req *http.Request)
- type Meta
- type MySQLInstance
- type SchemaInfoResult
- type TablesInSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzeResult ¶
type AnalyzeResult struct { CommonResult Config DMTaskConfig `json:"config"` }
AnalyzeResult is the result of AnalyzeConfig
type CommonResult ¶
CommonResult is the common result
type Config ¶
type Config struct { *flag.FlagSet `json:"-"` // Port is the port for server to listen Port int // TaskFilePath is the path used to save generated task config file TaskFilePath string // Timeout is the timeout for connect database and query, unit: second Timeout int // contains filtered or unexported fields }
Config is the dm-portal's config
type DBConfig ¶
type DBConfig struct { Host string `yaml:"host" json:"host"` Port int `yaml:"port" json:"port"` User string `yaml:"user" json:"user"` Password string `yaml:"password" json:"password"` }
DBConfig is the DB's config
type DMTaskConfig ¶
type DMTaskConfig struct { Name string `yaml:"name" json:"name"` TaskMode string `yaml:"task-mode" json:"task-mode"` IsSharding bool `yaml:"is-sharding" json:"is-sharding"` TargetDB *DBConfig `yaml:"target-database" json:"target-database"` MySQLInstances []*MySQLInstance `yaml:"mysql-instances" json:"mysql-instances"` Routes map[string]*router.TableRule `yaml:"routes" json:"routes"` Filters map[string]*bf.BinlogEventRule `yaml:"filters" json:"filters"` BWList map[string]*filter.Rules `yaml:"black-white-list" json:"black-white-list"` Mydumpers map[string]*config.MydumperConfig `yaml:"mydumpers" json:"mydumpers"` }
DMTaskConfig is the dm task's config used for dm-portal
func (*DMTaskConfig) String ¶
func (d *DMTaskConfig) String() string
func (*DMTaskConfig) Verify ¶
func (d *DMTaskConfig) Verify() error
Verify does verification on DMTaskConfig
type GenerateConfigResult ¶
type GenerateConfigResult struct { CommonResult Filepath string `json:"filepath"` }
GenerateConfigResult is the result of GenerateConfig
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler used for deal with http request
func NewHandler ¶
NewHandler returns a new Handler
func (*Handler) AnalyzeConfig ¶
func (p *Handler) AnalyzeConfig(w http.ResponseWriter, req *http.Request)
AnalyzeConfig analyzes dm task config from front-end
func (*Handler) Check ¶
func (p *Handler) Check(w http.ResponseWriter, req *http.Request)
Check checks database can be connected
func (*Handler) Download ¶
func (p *Handler) Download(w http.ResponseWriter, req *http.Request)
Download returns dm task config data for generate config file
func (*Handler) GenerateConfig ¶
func (p *Handler) GenerateConfig(w http.ResponseWriter, req *http.Request)
GenerateConfig generates config file used for dm
func (*Handler) GetSchemaInfo ¶
func (p *Handler) GetSchemaInfo(w http.ResponseWriter, req *http.Request)
GetSchemaInfo gets all schemas and tables information from a database
type Meta ¶
type Meta struct { BinLogName string `yaml:"binlog-name" json:"binlog-name"` BinLogPos uint32 `yaml:"binlog-pos" json:"binlog-pos"` }
Meta represents binlog's meta pos NOTE: refine to put these config structs into pkgs NOTE: now, syncer does not support GTID mode and which is supported by relay
type MySQLInstance ¶
type MySQLInstance struct { // it represents a MySQL/MariaDB instance or a replica group SourceID string `yaml:"source-id" json:"source-id"` Meta *Meta `yaml:"meta" json:"meta"` FilterRules []string `yaml:"filter-rules" json:"filter-rules"` RouteRules []string `yaml:"route-rules" json:"route-rules"` BWListName string `yaml:"black-white-list" json:"black-white-list"` MydumperConfigName string `yaml:"mydumper-config-name" json:"mydumper-config-name"` }
MySQLInstance represents a sync config of a MySQL instance
func (*MySQLInstance) Verify ¶
func (m *MySQLInstance) Verify() error
Verify does verification on MySQLInstance copied from https://github.com/pingcap/dm/blob/369933f31b8ff8246178a2b28df2cd98f88c64b9/dm/config/task.go#L94
type SchemaInfoResult ¶
type SchemaInfoResult struct { CommonResult Tables []TablesInSchema `json:"tables"` }
SchemaInfoResult is the result of GetSchemaInfo
type TablesInSchema ¶
TablesInSchema saves all the tables in one schema