portal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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 CheckResult

type CheckResult struct {
	CommonResult
}

CheckResult is the result of Check

type CommonResult

type CommonResult struct {
	Result string `json:"result"`
	Error  string `json:"error"`
}

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

func NewConfig

func NewConfig() *Config

NewConfig creates a new config.

func (*Config) Parse

func (cfg *Config) Parse(arguments []string)

Parse parses the cmd config

func (*Config) String

func (cfg *Config) String() string

String return config's string

func (*Config) Valid

func (cfg *Config) Valid() error

Valid checks whether the config is valid

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

func NewHandler(path string, timeout int) *Handler

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

func (*Meta) Verify

func (m *Meta) Verify() error

Verify does verification on configs

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

type TablesInSchema struct {
	Schema string   `json:"schema"`
	Tables []string `json:"tables"`
}

TablesInSchema saves all the tables in one schema

Directories

Path Synopsis
Package statik contains static assets.
Package statik contains static assets.

Jump to

Keyboard shortcuts

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