service

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCronTask

func AddCronTask(ctx context.Context, c *cron.Cron, cli *clientv3.Client, req *pb.OperateTaskRequest, job cron.Job) (*pb.OperateTaskResponse, error)

func ClearCronTask

func ClearCronTask(ctx context.Context, c *cron.Cron, cli *clientv3.Client, req *pb.OperateTaskRequest) (*pb.OperateTaskResponse, error)

func Counts added in v0.0.8

func Counts(ctx context.Context, serverAddr, taskName, schema string, table string, chunk string, file *os.File) error

func Decrypt added in v0.0.7

func Decrypt(ctx context.Context, serverAddr, taskName, schema string, table string, chunk string, file *os.File) error

func DeleteAssessMigrateTask

func DeleteAssessMigrateTask(ctx context.Context, req *pb.DeleteAssessMigrateTaskRequest) (string, error)

func DeleteCsvMigrateTask

func DeleteCsvMigrateTask(ctx context.Context, req *pb.DeleteCsvMigrateTaskRequest) (string, error)

func DeleteDataCompareTask

func DeleteDataCompareTask(ctx context.Context, req *pb.DeleteDataCompareTaskRequest) (string, error)

func DeleteDataScanTask

func DeleteDataScanTask(ctx context.Context, req *pb.DeleteDataScanTaskRequest) (string, error)

func DeleteDatabase

func DeleteDatabase(etcdClient *clientv3.Client, defaultDatabaseDBMSKey string) error

func DeleteDatasource

func DeleteDatasource(ctx context.Context, req *pb.DeleteDatasourceRequest) error

func DeleteSchemaRouteRule

func DeleteSchemaRouteRule(ctx context.Context, taskName []string) error

func DeleteSqlMigrateRule

func DeleteSqlMigrateRule(ctx context.Context, taskName []string) error

func DeleteSqlMigrateTask

func DeleteSqlMigrateTask(ctx context.Context, req *pb.DeleteSqlMigrateTaskRequest) (string, error)

func DeleteStmtMigrateTask

func DeleteStmtMigrateTask(ctx context.Context, req *pb.DeleteStmtMigrateTaskRequest) (string, error)

func DeleteStructCompareTask

func DeleteStructCompareTask(ctx context.Context, req *pb.DeleteStructCompareTaskRequest) (string, error)

func DeleteStructMigrateTask

func DeleteStructMigrateTask(ctx context.Context, req *pb.DeleteStructMigrateTaskRequest) (string, error)

func GenAssessMigrateTask

func GenAssessMigrateTask(ctx context.Context, serverAddr, taskName, outputDir string) error

func GenDataCompareTask

func GenDataCompareTask(ctx context.Context, serverAddr, taskName, schemaName, tableName, outputDir string, force bool) error

func GenDataScanTask

func GenDataScanTask(ctx context.Context, serverAddr, taskName, outputDir string) error

func GenStructCompareTask

func GenStructCompareTask(ctx context.Context, serverAddr, taskName, outputDir string) error

func GenStructMigrateTask

func GenStructMigrateTask(ctx context.Context, serverAddr, taskName, outputDir string) error

func PromptAssessMigrateTask added in v0.0.5

func PromptAssessMigrateTask(ctx context.Context, taskName, serverAddr string) error

func PromptCsvMigrateTask added in v0.0.5

func PromptCsvMigrateTask(ctx context.Context, taskName, serverAddr string) error

func PromptDataCompareTask added in v0.0.5

func PromptDataCompareTask(ctx context.Context, taskName, serverAddr string) error

func PromptDataScanTask added in v0.0.5

func PromptDataScanTask(ctx context.Context, taskName, serverAddr string) error

func PromptDatabase added in v0.0.7

func PromptDatabase(ctx context.Context, serverAddr string) error

func PromptDatasource added in v0.0.7

func PromptDatasource(ctx context.Context, serverAddr string, datasources []string) error

func PromptSqlMigrateTask added in v0.0.5

func PromptSqlMigrateTask(ctx context.Context, taskName, serverAddr string) error

func PromptStmtMigrateTask added in v0.0.5

func PromptStmtMigrateTask(ctx context.Context, taskName, serverAddr string) error

func PromptStructCompareTask added in v0.0.5

func PromptStructCompareTask(ctx context.Context, taskName, serverAddr string) error

func PromptStructMigrateTask added in v0.0.5

func PromptStructMigrateTask(ctx context.Context, taskName, serverAddr string) error

func ShowAssessMigrateTask

func ShowAssessMigrateTask(ctx context.Context, req *pb.ShowAssessMigrateTaskRequest) (string, error)

func ShowCsvMigrateTask

func ShowCsvMigrateTask(ctx context.Context, req *pb.ShowCsvMigrateTaskRequest) (string, error)

func ShowDataCompareTask

func ShowDataCompareTask(ctx context.Context, req *pb.ShowDataCompareTaskRequest) (string, error)

func ShowDataScanTask

func ShowDataScanTask(ctx context.Context, req *pb.ShowDataScanTaskRequest) (string, error)

func ShowDatabase

func ShowDatabase(etcdClient *clientv3.Client, defaultDatabaseDBMSKey string) (string, error)

func ShowDatasource

func ShowDatasource(ctx context.Context, req *pb.ShowDatasourceRequest) (string, error)

func ShowSchemaRouteRule

func ShowSchemaRouteRule(ctx context.Context, taskName string) (*pb.SchemaRouteRule, []*pb.DataMigrateRule, []*pb.DataCompareRule, error)

func ShowSqlMigrateRule

func ShowSqlMigrateRule(ctx context.Context, taskName string) ([]*pb.SqlMigrateRule, error)

func ShowSqlMigrateTask

func ShowSqlMigrateTask(ctx context.Context, req *pb.ShowSqlMigrateTaskRequest) (string, error)

func ShowStmtMigrateTask

func ShowStmtMigrateTask(ctx context.Context, req *pb.ShowStmtMigrateTaskRequest) (string, error)

func ShowStructCompareTask

func ShowStructCompareTask(ctx context.Context, req *pb.ShowStructCompareTaskRequest) (string, error)

func ShowStructMigrateTask

func ShowStructMigrateTask(ctx context.Context, req *pb.ShowStructMigrateTaskRequest) (string, error)

func StartAssessMigrateTask

func StartAssessMigrateTask(ctx context.Context, taskName, workerAddr string) error

func StartCsvMigrateTask

func StartCsvMigrateTask(ctx context.Context, taskName, workerAddr string) error

func StartDataCompareTask

func StartDataCompareTask(ctx context.Context, taskName, workerAddr string) error

func StartDataScanTask

func StartDataScanTask(ctx context.Context, taskName, workerAddr string) error

func StartSqlMigrateTask

func StartSqlMigrateTask(ctx context.Context, taskName, workerAddr string) error

func StartStmtMigrateTask

func StartStmtMigrateTask(ctx context.Context, taskName, workerAddr string) error

func StartStructCompareTask

func StartStructCompareTask(ctx context.Context, taskName, workerAddr string) error

func StartStructMigrateTask

func StartStructMigrateTask(ctx context.Context, taskName, workerAddr string) error

func StartTask

func StartTask(ctx context.Context, cli *clientv3.Client, discoveries *etcdutil.Discovery, req *pb.OperateTaskRequest) (*pb.OperateTaskResponse, error)

func StopAssessMigrateTask

func StopAssessMigrateTask(ctx context.Context, taskName string) error

func StopCsvMigrateTask

func StopCsvMigrateTask(ctx context.Context, taskName string) error

func StopDataCompareTask

func StopDataCompareTask(ctx context.Context, taskName string) error

func StopDataScanTask

func StopDataScanTask(ctx context.Context, taskName string) error

func StopSqlMigrateTask

func StopSqlMigrateTask(ctx context.Context, taskName string) error

func StopStmtMigrateTask

func StopStmtMigrateTask(ctx context.Context, taskName string) error

func StopStructCompareTask

func StopStructCompareTask(ctx context.Context, taskName string) error

func StopStructMigrateTask

func StopStructMigrateTask(ctx context.Context, taskName string) error

func UpsertAssessMigrateTask

func UpsertAssessMigrateTask(ctx context.Context, req *pb.UpsertAssessMigrateTaskRequest) (string, error)

func UpsertCsvMigrateTask

func UpsertCsvMigrateTask(ctx context.Context, req *pb.UpsertCsvMigrateTaskRequest) (string, error)

func UpsertDataCompareTask

func UpsertDataCompareTask(ctx context.Context, req *pb.UpsertDataCompareTaskRequest) (string, error)

func UpsertDataScanTask

func UpsertDataScanTask(ctx context.Context, req *pb.UpsertDataScanTaskRequest) (string, error)

func UpsertDatabase

func UpsertDatabase(etcdClient *clientv3.Client, defaultDatabaseDBMSKey string, req *pb.UpsertDatabaseRequest) (string, error)

func UpsertDatasource

func UpsertDatasource(ctx context.Context, req *pb.UpsertDatasourceRequest) (string, error)

func UpsertSchemaRouteRule

func UpsertSchemaRouteRule(ctx context.Context, taskName, datasourceNameS string, caseFieldRule *pb.CaseFieldRule, schemaRouteRule *pb.SchemaRouteRule,
	dataMigrateRules []*pb.DataMigrateRule, dataCompareRules []*pb.DataCompareRule) error

func UpsertSqlMigrateRule

func UpsertSqlMigrateRule(ctx context.Context, taskName string, caseFieldRule *pb.CaseFieldRule, sqlRouteRule []*pb.SqlMigrateRule) error

func UpsertSqlMigrateTask

func UpsertSqlMigrateTask(ctx context.Context, req *pb.UpsertSqlMigrateTaskRequest) (string, error)

func UpsertStmtMigrateTask

func UpsertStmtMigrateTask(ctx context.Context, req *pb.UpsertStmtMigrateTaskRequest) (string, error)

func UpsertStructCompareTask

func UpsertStructCompareTask(ctx context.Context, req *pb.UpsertStructCompareTaskRequest) (string, error)

func UpsertStructMigrateTask

func UpsertStructMigrateTask(ctx context.Context, req *pb.UpsertStructMigrateTaskRequest) (string, error)

Types

type CompareCounts added in v0.0.8

type CompareCounts struct {
	SchemaNameS    string          `json:"schemaNameS"`
	TableNameS     string          `json:"tableNameS"`
	ChunkTotals    int64           `json:"chunkTotals"`
	CompareDetails []CompareDetail `json:"compareDetails"`
}

type CompareDecrypt added in v0.0.8

type CompareDecrypt struct {
	ChunkID      string `json:"chunkID"`
	SchemaNameS  string `json:"schemaNameS"`
	TableNameS   string `json:"tableNameS"`
	SchemaNameT  string `json:"schemaNameT"`
	TableNameT   string `json:"tableNameT"`
	ChunkDetailS string `json:"chunkDetailS"`
	ChunkArgsS   string `json:"chunkArgsS"`
	ChunkDetailT string `json:"chunkDetailT"`
	ChunkArgsT   string `json:"chunkArgsT"`
	TaskStatus   string `json:"taskStatus"`
}

type CompareDetail added in v0.0.8

type CompareDetail struct {
	ChunkID      string `json:"chunkID"`
	SchemaNameS  string `json:"schemaNameS"`
	TableNameS   string `json:"tableNameS"`
	SchemaNameT  string `json:"schemaNameT"`
	TableNameT   string `json:"tableNameT"`
	ChunkCounts  int64  `json:"chunkCounts"`
	ChunkDetailS string `json:"chunkDetailS"`
	ChunkArgsS   string `json:"chunkArgsS"`
	ChunkDetailT string `json:"chunkDetailT"`
	ChunkArgsT   string `json:"chunkArgsT"`
	TaskStatus   string `json:"taskStatus"`
}

type Cronjob

type Cronjob struct {
	// contains filtered or unexported fields
}

func NewCronjob

func NewCronjob(
	cli *clientv3.Client, discoveries *etcdutil.Discovery, taskName string) *Cronjob

func (*Cronjob) Run

func (c *Cronjob) Run()

type Crontab

type Crontab struct {
	// contains filtered or unexported fields
}

func NewServiceCrontab

func NewServiceCrontab(ctx context.Context, etcdCli *clientv3.Client, discoveries *etcdutil.Discovery, cron *cron.Cron) *Crontab

func (*Crontab) Close

func (c *Crontab) Close() error

Close used for close service

func (*Crontab) Load

func (c *Crontab) Load(expressPrefixKey string) error

type Express added in v0.0.1

type Express struct {
	TaskName string
	EntryID  cron.EntryID
	Express  string
}

Express used to the store key-value information

func DisplayCronTask added in v0.0.1

func DisplayCronTask(ctx context.Context, serverAddr, taskName string) ([]*Express, error)

func (*Express) String added in v0.0.1

func (e *Express) String() string

type List added in v0.0.5

type List struct {
	TaskName        string `json:"taskName"`
	TaskFlow        string `json:"taskFlow"`
	TaskMode        string `json:"taskMode"`
	CaseFieldRuleS  string `json:"caseFieldRuleS"`
	CaseFieldRuleT  string `json:"caseFieldRuleT"`
	DatasourceNameS string `json:"datasourceNameS"`
	DatasourceNameT string `json:"datasourceNameT"`
	TaskStatus      string `json:"taskStatus"`
	WorkerAddr      string `json:"workerAddr"`
}

func ListTask added in v0.0.5

func ListTask(ctx context.Context, taskName, serverAddr string) ([]List, error)

type MigrateCounts added in v0.0.8

type MigrateCounts struct {
	SchemaNameS    string          `json:"schemaNameS"`
	TableNameS     string          `json:"tableNameS"`
	ChunkTotals    int64           `json:"chunkTotals"`
	MigrateDetails []MigrateDetail `json:"migrateDetails"`
}

type MigrateDecrypt added in v0.0.8

type MigrateDecrypt struct {
	ChunkID       string `json:"chunkID"`
	SchemaNameS   string `json:"schemaNameS"`
	TableNameS    string `json:"tableNameS"`
	SchemaNameT   string `json:"schemaNameT"`
	TableNameT    string `json:"tableNameT"`
	ChunkDetailS  string `json:"chunkDetailS"`
	ChunkArgsS    string `json:"chunkArgsS"`
	ColumnDetailS string `json:"columnDetailS"`
	ColumnDetailT string `json:"columnDetailT"`
	TaskStatus    string `json:"taskStatus"`
}

type MigrateDetail added in v0.0.8

type MigrateDetail struct {
	ChunkID       string `json:"chunkID"`
	SchemaNameS   string `json:"schemaNameS"`
	TableNameS    string `json:"tableNameS"`
	SchemaNameT   string `json:"schemaNameT"`
	TableNameT    string `json:"tableNameT"`
	ChunkCounts   int64  `json:"chunkCounts"`
	ChunkDetailS  string `json:"chunkDetailS"`
	ChunkArgsS    string `json:"chunkArgsS"`
	ColumnDetailS string `json:"columnDetailS"`
	ColumnDetailT string `json:"columnDetailT"`
	TaskStatus    string `json:"taskStatus"`
}

type ScanCounts added in v0.0.8

type ScanCounts struct {
	SchemaNameS string       `json:"schemaNameS"`
	TableNameS  string       `json:"tableNameS"`
	ChunkTotals int64        `json:"chunkTotals"`
	ScanDetail  []ScanDetail `json:"scanDetail"`
}

type ScanDecrypt added in v0.0.8

type ScanDecrypt struct {
	ChunkID       string `json:"chunkID"`
	SchemaNameS   string `json:"schemaNameS"`
	TableNameS    string `json:"tableNameS"`
	ColumnDetailS string `json:"columnDetailS"`
	ChunkDetailS  string `json:"chunkDetailS"`
	ChunkArgsS    string `json:"chunkArgsS"`
	Samplerate    string `json:"samplerate"`
	TaskStatus    string `json:"taskStatus"`
}

type ScanDetail added in v0.0.8

type ScanDetail struct {
	ChunkID       string `json:"chunkID"`
	SchemaNameS   string `json:"schemaNameS"`
	TableNameS    string `json:"tableNameS"`
	ChunkCounts   int64  `json:"chunkCounts"`
	ColumnDetailS string `json:"columnDetailS"`
	ChunkDetailS  string `json:"chunkDetailS"`
	ChunkArgsS    string `json:"chunkArgsS"`
	Samplerate    string `json:"samplerate"`
	TaskStatus    string `json:"taskStatus"`
}

type Status added in v0.0.5

type Status struct {
	TaskName        string   `json:"taskName"`
	TaskFlow        string   `json:"taskFlow"`
	TaskMode        string   `json:"taskMode"`
	DatasourceNameS string   `json:"datasourceNameS"`
	DatasourceNameT string   `json:"datasourceNameT"`
	TaskStatus      string   `json:"taskStatus"`
	WorkerAddr      string   `json:"workerAddr"`
	LogDetail       []string `json:"logDetail"`
}

func StatusTask added in v0.0.5

func StatusTask(ctx context.Context, taskName, serverAddr string, last int) (Status, error)

Jump to

Keyboard shortcuts

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