forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server,migration: generate EveryNode req/resp helpers
We expect to add multiple req/resp types as individual operations for the EveryNode RPC. Each of these operations will correspond to a "primitive" of sorts for the (long running) migrations infrastructure. It's a bit cumbersome to wield this nested union type, so we autogenerate helper code to do it for us. We take precedence from api.proto and all the very many batch request/responses. Release note: None
- Loading branch information
1 parent
9ccb3f9
commit c260c85
Showing
7 changed files
with
287 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2018 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package serverpb | ||
|
||
//go:generate go run -tags gen-everynode gen_everynode.go | ||
|
||
// EveryNodeOp is an interface satisfied by all allowable EveryNode requests. | ||
type EveryNodeOp interface { | ||
Op() string | ||
} | ||
|
||
// EveryNodeOpResp is an interface satisfied by all allowable EveryNode responses. | ||
type EveryNodeOpResp interface { | ||
everyNodeOpResp() | ||
} | ||
|
||
// Op implements the EveryNodeOp interface. | ||
func (a *AckClusterVersionRequest) Op() string { return "ack-cluster-version" } | ||
|
||
// everyNodeOpResp implements the EveryNodeOpResp interface. | ||
func (a *AckClusterVersionResponse) everyNodeOpResp() {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.