Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the concept of thirdparty impls to Vitess #17544

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ report
# mise files
.mise.toml
/errors/

# thirdparty
/go/thirdparty/
3 changes: 3 additions & 0 deletions go/cmd/vtgate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"vitess.io/vitess/go/acl"
"vitess.io/vitess/go/exit"
"vitess.io/vitess/go/stats"
"vitess.io/vitess/go/thirdparty"
"vitess.io/vitess/go/vt/discovery"
"vitess.io/vitess/go/vt/servenv"
"vitess.io/vitess/go/vt/srvtopo"
Expand Down Expand Up @@ -80,6 +81,8 @@ var (

func init() {
srvTopoCounts = stats.NewCountersWithSingleLabel("ResilientSrvTopoServer", "Resilient srvtopo server operations", "type")
// Initalize any third party implementations for vitess
thirdparty.InitializeThirdParty(Main)
}

// CheckCellFlags will check validation of cell and cells_to_watch flag
Expand Down
17 changes: 17 additions & 0 deletions go/thirdparty/thirdparty.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package thirdparty

import (
"sync"

"github.com/spf13/cobra"
)

var once sync.Once

func InitializeThirdParty(command *cobra.Command) {
// only initialize once
once.Do(func() {
// initialize/register any third part implementations

})
}