Skip to content

Commit

Permalink
Remove enumvalue_customname, goproto_enum_prefix and enum_customname
Browse files Browse the repository at this point in the history
This commit removes gogoproto.enumvalue_customname,
gogoproto.goproto_enum_prefix and gogoproto.enum_customname.

All of them make proto-generated Go code more idiomatic, but we already
don't use these enums in our external-surfacing types and they are anyway
not supported by Google's official toolchain (see containerd#6564).

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys authored and Kirtana Ashok committed Jan 18, 2023
1 parent 28f0e2d commit a7ff6f0
Show file tree
Hide file tree
Showing 22 changed files with 269 additions and 361 deletions.
51 changes: 0 additions & 51 deletions api/next.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1616,27 +1616,14 @@ file {
value {
name: "STAT"
number: 0
options {
66001: "WriteActionStat"
}
}
value {
name: "WRITE"
number: 1
options {
66001: "WriteActionWrite"
}
}
value {
name: "COMMIT"
number: 2
options {
66001: "WriteActionCommit"
}
}
options {
62001: 0
62023: "WriteAction"
}
}
service {
Expand Down Expand Up @@ -3404,34 +3391,18 @@ file {
value {
name: "UNKNOWN"
number: 0
options {
66001: "KindUnknown"
}
}
value {
name: "VIEW"
number: 1
options {
66001: "KindView"
}
}
value {
name: "ACTIVE"
number: 2
options {
66001: "KindActive"
}
}
value {
name: "COMMITTED"
number: 3
options {
66001: "KindCommitted"
}
}
options {
62001: 0
62023: "Kind"
}
}
service {
Expand Down Expand Up @@ -3642,48 +3613,26 @@ file {
value {
name: "UNKNOWN"
number: 0
options {
66001: "StatusUnknown"
}
}
value {
name: "CREATED"
number: 1
options {
66001: "StatusCreated"
}
}
value {
name: "RUNNING"
number: 2
options {
66001: "StatusRunning"
}
}
value {
name: "STOPPED"
number: 3
options {
66001: "StatusStopped"
}
}
value {
name: "PAUSED"
number: 4
options {
66001: "StatusPaused"
}
}
value {
name: "PAUSING"
number: 5
options {
66001: "StatusPausing"
}
}
options {
62001: 0
62023: "Status"
}
}
syntax: "proto3"
Expand Down
136 changes: 66 additions & 70 deletions api/services/content/v1/content.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions api/services/content/v1/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,17 @@ message ListStatusesResponse {

// WriteAction defines the behavior of a WriteRequest.
enum WriteAction {
option (gogoproto.goproto_enum_prefix) = false;
option (gogoproto.enum_customname) = "WriteAction";

// WriteActionStat instructs the writer to return the current status while
// holding the lock on the write.
STAT = 0 [(gogoproto.enumvalue_customname) = "WriteActionStat"];
STAT = 0;

// WriteActionWrite sets the action for the write request to write data.
//
// Any data included will be written at the provided offset. The
// transaction will be left open for further writes.
//
// This is the default.
WRITE = 1 [(gogoproto.enumvalue_customname) = "WriteActionWrite"];
WRITE = 1;

// WriteActionCommit will write any outstanding data in the message and
// commit the write, storing it under the digest.
Expand All @@ -228,7 +225,7 @@ enum WriteAction {
// commit it.
//
// This action will always terminate the write.
COMMIT = 2 [(gogoproto.enumvalue_customname) = "WriteActionCommit"];
COMMIT = 2;
}

// WriteContentRequest writes data to the request ref at offset.
Expand Down
Loading

0 comments on commit a7ff6f0

Please sign in to comment.