Skip to content

Commit

Permalink
lightning: enable nogo checks for restore-opts (#37615)
Browse files Browse the repository at this point in the history
close #37614
  • Loading branch information
dsdashun committed Sep 5, 2022
1 parent 80841ac commit 6b8cf9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions br/pkg/lightning/restore/opts/precheck_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,27 @@ package opts

import "github.com/pingcap/tidb/br/pkg/lightning/mydump"

// PrecheckItemBuilderConfig defines the config used in a precheck builder,
// which affects the behavior for executing precheck items.
type PrecheckItemBuilderConfig struct {
PreInfoGetterOptions []GetPreInfoOption
MDLoaderSetupOptions []mydump.MDLoaderSetupOption
}

// PrecheckItemBuilderOption defines the options when constructing a precheck builder,
// which affects the behavior for executing precheck items.
type PrecheckItemBuilderOption func(c *PrecheckItemBuilderConfig)

// WithPreInfoGetterOptions generates a precheck item builder option
// to control the get pre info behaviors.
func WithPreInfoGetterOptions(opts ...GetPreInfoOption) PrecheckItemBuilderOption {
return func(c *PrecheckItemBuilderConfig) {
c.PreInfoGetterOptions = append([]GetPreInfoOption{}, opts...)
}
}

// WithMDLoaderSetupOptions generates a precheck item builder option
// to control the mydumper loader setup behaviors.
func WithMDLoaderSetupOptions(opts ...mydump.MDLoaderSetupOption) PrecheckItemBuilderOption {
return func(c *PrecheckItemBuilderConfig) {
c.MDLoaderSetupOptions = append([]mydump.MDLoaderSetupOption{}, opts...)
Expand Down
4 changes: 4 additions & 0 deletions build/nogo_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
},
"only_files": {
"br/pkg/lightning/mydump/": "br/pkg/lightning/mydump/",
"br/pkg/lightning/restore/opts": "br/pkg/lightning/restore/opts",
"executor/aggregate.go": "executor/aggregate.go",
"types/json/binary_functions.go": "types/json/binary_functions.go",
"types/json/binary_test.go": "types/json/binary_test.go",
Expand Down Expand Up @@ -324,6 +325,7 @@
},
"only_files": {
"br/pkg/lightning/mydump/": "br/pkg/lightning/mydump/",
"br/pkg/lightning/restore/opts": "br/pkg/lightning/restore/opts",
"kv/": "kv code",
"util/memory": "util/memory",
"ddl/": "ddl",
Expand Down Expand Up @@ -351,6 +353,7 @@
},
"only_files": {
"br/pkg/lightning/mydump/": "br/pkg/lightning/mydump/",
"br/pkg/lightning/restore/opts": "br/pkg/lightning/restore/opts",
"executor/aggregate.go": "executor/aggregate.go",
"types/json/binary_functions.go": "types/json/binary_functions.go",
"types/json/binary_test.go": "types/json/binary_test.go",
Expand Down Expand Up @@ -713,6 +716,7 @@
},
"only_files": {
"br/pkg/lightning/mydump/": "br/pkg/lightning/mydump/",
"br/pkg/lightning/restore/opts": "br/pkg/lightning/restore/opts",
"executor/aggregate.go": "executor/aggregate.go",
"types/json/binary_functions.go": "types/json/binary_functions.go",
"types/json/binary_test.go": "types/json/binary_test.go",
Expand Down

0 comments on commit 6b8cf9d

Please sign in to comment.