1

feat: stub out RPCs

This commit is contained in:
Mya 2023-12-29 14:01:47 -06:00
parent c8b53c54f4
commit 2a72024da0
Signed by: mya
GPG Key ID: 4DFBA0F91AC3544A
9 changed files with 262 additions and 6 deletions

View File

@ -1,3 +1,21 @@
define HELP_TEXT
Welcome!
Targets:
help provides help text
deps resolve dependencies
lint lint source for errors or breaking changes
legal prepends license to source code
endef
export HELP_TEXT
help:
@echo "$$HELP_TEXT"
deps:
buf mod update
lint:
buf lint
addlicense -check -f ./legal/header.txt -skip yaml -skip yml -skip xml .

8
buf.lock Normal file
View File

@ -0,0 +1,8 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: a86849a25cc04f4dbe9b15ddddfbc488
digest: shake256:e19143328f8cbfe13fc226aeee5e63773ca494693a72740a7560664270039a380d94a1344234b88c7691311460df9a9b1c2982190d0a2612eae80368718e1943

View File

@ -1,4 +1,6 @@
version: v1
deps:
- buf.build/googleapis/googleapis
lint:
use:
- DEFAULT

View File

@ -12,6 +12,44 @@ syntax = "proto3";
package contributors.v1;
service ContributorService {
import "google/api/annotations.proto";
message ListRequest {}
message ListResponse {}
message CreateRequest {}
message CreateResponse {}
message UpdateRequest {}
message UpdateResponse {}
message DeleteRequest {}
message DeleteResponse {}
service ContributorService {
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/products/{product_id}/contributors"
};
};
rpc Create(CreateRequest) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/products/{product_id}/contributors"
body: "*"
};
};
rpc Update(UpdateRequest) returns (UpdateResponse) {
option (google.api.http) = {
post: "/v1/products/{product_id}/contributors/{contributor_id}"
body: "*"
};
};
rpc Delete(DeleteRequest) returns (DeleteResponse) {
option (google.api.http) = {
delete: "/v1/products/{product_id}/contributors/{contributor_id}"
};
};
}

View File

@ -12,6 +12,35 @@ syntax = "proto3";
package licenses.v1;
service LicenseService {
import "google/api/annotations.proto";
message ListRequest {}
message ListResponse {}
message PurchaseRequest {}
message PurchaseResponse {}
message CancelRequest {}
message CancelResponse {}
service LicenseService {
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/licenses"
};
};
rpc Purchase(PurchaseRequest) returns (PurchaseResponse) {
option (google.api.http) = {
post: "/v1/licenses"
body: "*"
};
};
rpc Cancel(CancelRequest) returns (CancelResponse) {
option (google.api.http) = {
post: "/v1/licenses/{license_id}"
body: "*"
};
};
}

View File

@ -12,6 +12,53 @@ syntax = "proto3";
package packages.v1;
service PackageService {
import "google/api/annotations.proto";
message ListRequest {}
message ListResponse {}
message CreateRequest {}
message CreateResponse {}
message ReadRequest {}
message ReadResponse {}
message UpdateRequest {}
message UpdateResponse {}
message DeleteRequest {}
message DeleteResponse {}
service PackageService {
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/products/{product_id}/packages"
};
};
rpc Create(CreateRequest) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/products/{product_id}/packages"
body: "*"
};
};
rpc Read(ReadRequest) returns (ReadResponse) {
option (google.api.http) = {
get: "/v1/products/{product_id}/packages/{package_name}"
};
};
rpc Update(UpdateRequest) returns (UpdateResponse) {
option (google.api.http) = {
post: "/v1/products/{product_id}/packages/{package_name}"
body: "*"
};
};
rpc Delete(DeleteRequest) returns (DeleteResponse) {
option (google.api.http) = {
delete: "/v1/products/{product_id}/packages/{package_name}"
};
};
}

View File

@ -12,6 +12,53 @@ syntax = "proto3";
package products.v1;
service ProductService {
import "google/api/annotations.proto";
message ListRequest {}
message ListResponse {}
message CreateRequest {}
message CreateResponse {}
message ReadRequest {}
message ReadResponse {}
message UpdateRequest {}
message UpdateResponse {}
message DeleteRequest {}
message DeleteResponse {}
service ProductService {
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/products"
};
};
rpc Create(CreateRequest) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/products"
body: "*"
};
};
rpc Read(ReadRequest) returns (ReadResponse) {
option (google.api.http) = {
get: "/v1/products/{product_id}"
};
};
rpc Update(UpdateRequest) returns (UpdateResponse) {
option (google.api.http) = {
post: "/v1/products/{product_id}"
body: "*"
};
};
rpc Delete(DeleteRequest) returns (DeleteResponse) {
option (google.api.http) = {
delete: "/v1/products/{product_id}"
};
};
}

55
tokens/v1/service.proto Normal file
View File

@ -0,0 +1,55 @@
// Copyright (C) 2023 The Licensing Authors
// SPDX-License-Identifier: MIT
//
// This file attempts to follow common styles and design patterns described by
// Google Cloud based on their extensive use of protocol buffers.
//
// - See here for more: https://cloud.google.com/apis/design/design_patterns
//
syntax = "proto3";
package tokens.v1;
import "google/api/annotations.proto";
message AuthenticateRequest {}
message AuthenticateResponse {}
message ListRequest {}
message ListResponse {}
message CreateRequest {}
message CreateResponse {}
message DeleteRequest {}
message DeleteResponse {}
service TokenService {
rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) {
option (google.api.http) = {
post: "/v1/token"
body: "*"
};
};
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/tokens"
};
};
rpc Create(CreateRequest) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/tokens"
body: "*"
};
};
rpc Delete(DeleteRequest) returns (DeleteResponse) {
option (google.api.http) = {
delete: "/v1/tokens/{token_id}"
};
};
}

View File

@ -12,6 +12,8 @@ syntax = "proto3";
package users.v1;
import "google/api/annotations.proto";
message SignupRequest {}
message SignupResponse {}
@ -19,6 +21,16 @@ message CurrentRequest {}
message CurrentResponse {}
service UserService {
rpc Signup(SignupRequest) returns (SignupResponse);
rpc Current(CurrentRequest) returns (CurrentResponse);
rpc Signup(SignupRequest) returns (SignupResponse) {
option (google.api.http) = {
post: "/v1/users"
body: "*"
};
};
rpc Current(CurrentRequest) returns (CurrentResponse) {
option (google.api.http) = {
get: "/v1/users/current"
};
};
}