Skip to content

Commit

Permalink
Update approach to not require another binary to run vtshovel
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
  • Loading branch information
rafael committed Oct 17, 2019
1 parent 8bf38cc commit b56bf67
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 399 deletions.
196 changes: 0 additions & 196 deletions go/cmd/vtshovel/vtshovel.go

This file was deleted.

25 changes: 18 additions & 7 deletions go/vt/dbconfigs/dbconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ const (
// AllPrivs user should have more privileges than App (should include possibility to do
// schema changes and write to internal Vitess tables), but it shouldn't have SUPER
// privilege like Dba has.
AllPrivs = "allprivs"
Dba = "dba"
Filtered = "filtered"
Repl = "repl"
AllPrivs = "allprivs"
Dba = "dba"
Filtered = "filtered"
Repl = "repl"
ExternalRepl = "erepl"
)

// All can be used to register all flags: RegisterFlags(All...)
var All = []string{App, AppDebug, AllPrivs, Dba, Filtered, Repl}
var All = []string{App, AppDebug, AllPrivs, Dba, Filtered, Repl, ExternalRepl}

// RegisterFlags registers the flags for the given DBConfigFlag.
// For instance, vttablet will register client, dba and repl.
Expand Down Expand Up @@ -157,16 +158,26 @@ func (dbcfgs *DBConfigs) DbaWithDB() *mysql.ConnParams {
return dbcfgs.makeParams(Dba, true)
}

// FilteredWithDB returns connection parameters for appdebug with dbname set.
// FilteredWithDB returns connection parameters for filtered with dbname set.
func (dbcfgs *DBConfigs) FilteredWithDB() *mysql.ConnParams {
return dbcfgs.makeParams(Filtered, true)
}

// Repl returns connection parameters for appdebug with no dbname set.
// Repl returns connection parameters for repl with no dbname set.
func (dbcfgs *DBConfigs) Repl() *mysql.ConnParams {
return dbcfgs.makeParams(Repl, false)
}

// ExternalRepl returns connection parameters for repl with no dbname set.
func (dbcfgs *DBConfigs) ExternalRepl() *mysql.ConnParams {
return dbcfgs.makeParams(Repl, false)
}

// ExternalReplWithDb returns connection parameters for repl with dbname set.
func (dbcfgs *DBConfigs) ExternalReplWithDb() *mysql.ConnParams {
return dbcfgs.makeParams(Repl, true)
}

// AppWithDB returns connection parameters for app with dbname set.
func (dbcfgs *DBConfigs) makeParams(userKey string, withDB bool) *mysql.ConnParams {
orig := dbcfgs.userConfigs[userKey]
Expand Down
Loading

1 comment on commit b56bf67

@jawabuu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rafael . Trying to understand how this would run without a separate binary.

Please sign in to comment.