forked from douyu/jupiter-layout
-
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.
feat: support define error by proto (douyu#84)
- Loading branch information
Showing
17 changed files
with
473 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ deps: | |
lint: | ||
ignore: | ||
- vendor | ||
- error/v1 | ||
|
||
use: | ||
- DEFAULT | ||
- COMMENTS | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
syntax = "proto3"; | ||
|
||
package error.v1; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "github.com/douyu/jupiter-layout/api/error/v1;errorv1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "ErrorProtoV1"; | ||
option java_package = "com.douyu.error.v1"; | ||
|
||
// Extend the google.protobuf.EnumValueOptions to add a custom option | ||
extend google.protobuf.EnumValueOptions { | ||
// msg is the error message for enum value | ||
string msg = 9527; | ||
} |
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,15 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "error/v1/error.proto", | ||
"version": "version not set" | ||
}, | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": {}, | ||
"definitions": {} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
syntax = "proto3"; | ||
|
||
package helloworld.v1; | ||
|
||
import "error/v1/error.proto"; | ||
|
||
option go_package = "github.com/douyu/jupiter-layout/api/helloworld/v1;helloworldv1"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "HelloWorldProtoV1"; | ||
option java_package = "com.douyu.helloworld.v1"; | ||
|
||
// Error codes for the helloworld.v1 package. | ||
enum Error { | ||
// ERROR_UNSPECIFIED is the invalid code. | ||
ERROR_UNSPECIFIED = 0; | ||
// ERROR_NAME_EMPTY is the error code for empty name. | ||
ERROR_NAME_EMPTY = 1000 [(error.v1.msg) = "name is empty"]; | ||
} |
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,15 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "helloworld/v1/error.proto", | ||
"version": "version not set" | ||
}, | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"paths": {}, | ||
"definitions": {} | ||
} |
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.