-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample files for Buf plugin tutorial (#33)
Docs updates PR: bufbuild/buf.build#1865
- Loading branch information
Showing
5 changed files
with
96 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: v2 | ||
modules: | ||
- path: proto | ||
name: buf.build/tutorials/create-buf-plugin | ||
lint: | ||
use: | ||
- DEFAULT | ||
- RPC_SUFFIX | ||
breaking: | ||
use: | ||
- FILE | ||
plugins: | ||
- plugin: rpc-suffix | ||
options: | ||
forbidden_rpc_suffixes: | ||
- Method | ||
- RPC |
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,32 @@ | ||
syntax = "proto3"; | ||
|
||
package pet.v1; | ||
|
||
// PetType represents the different types of pets in the pet store. | ||
enum PetType { | ||
PET_TYPE_UNSPECIFIED = 0; | ||
PET_TYPE_CAT = 1; | ||
PET_TYPE_DOG = 2; | ||
PET_TYPE_SNAKE = 3; | ||
PET_TYPE_HAMSTER = 4; | ||
} | ||
|
||
// Pet represents a pet in the pet store. | ||
message Pet { | ||
PetType pet_type = 1; | ||
string pet_id = 2; | ||
string name = 3; | ||
} | ||
|
||
message GetPetRequest { | ||
string pet_id = 1; | ||
} | ||
|
||
message GetPetResponse { | ||
Pet pet = 1; | ||
} | ||
|
||
service PetStoreService { | ||
rpc GetPet(GetPetRequest) returns (GetPetResponse) {} | ||
|
||
} |
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,10 @@ | ||
version: v2 | ||
modules: | ||
- path: proto | ||
name: buf.build/tutorials/create-buf-plugin | ||
lint: | ||
use: | ||
- DEFAULT | ||
breaking: | ||
use: | ||
- FILE |
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,32 @@ | ||
syntax = "proto3"; | ||
|
||
package pet.v1; | ||
|
||
// PetType represents the different types of pets in the pet store. | ||
enum PetType { | ||
PET_TYPE_UNSPECIFIED = 0; | ||
PET_TYPE_CAT = 1; | ||
PET_TYPE_DOG = 2; | ||
PET_TYPE_SNAKE = 3; | ||
PET_TYPE_HAMSTER = 4; | ||
} | ||
|
||
// Pet represents a pet in the pet store. | ||
message Pet { | ||
PetType pet_type = 1; | ||
string pet_id = 2; | ||
string name = 3; | ||
} | ||
|
||
message GetPetRequest { | ||
string pet_id = 1; | ||
} | ||
|
||
message GetPetResponse { | ||
Pet pet = 1; | ||
} | ||
|
||
service PetStoreService { | ||
rpc GetPetMethod(GetPetRequest) returns (GetPetResponse) {} | ||
|
||
} |