Add accounts RPCs

This commit is contained in:
Nikolai Rodionov 2024-03-18 11:14:42 +01:00
parent 5a816b2084
commit 9060b308bd
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
3 changed files with 161 additions and 3 deletions

122
README.md
View File

@ -3,7 +3,7 @@
## Table of Contents ## Table of Contents
- [proto/environments_v1.proto](#proto_environments_v1-proto) - [environments/environments_v1.proto](#environments_environments_v1-proto)
- [EnvironmentData](#environments-EnvironmentData) - [EnvironmentData](#environments-EnvironmentData)
- [EnvironmentFull](#environments-EnvironmentFull) - [EnvironmentFull](#environments-EnvironmentFull)
- [EnvironmentId](#environments-EnvironmentId) - [EnvironmentId](#environments-EnvironmentId)
@ -12,14 +12,23 @@
- [Environments](#environments-Environments) - [Environments](#environments-Environments)
- [accounts/accounts_v1.proto](#accounts_accounts_v1-proto)
- [AccountData](#accounts-AccountData)
- [AccountFull](#accounts-AccountFull)
- [AccountId](#accounts-AccountId)
- [AccountPassword](#accounts-AccountPassword)
- [AccountWithPassword](#accounts-AccountWithPassword)
- [Accounts](#accounts-Accounts)
- [Scalar Value Types](#scalar-value-types) - [Scalar Value Types](#scalar-value-types)
<a name="proto_environments_v1-proto"></a> <a name="environments_environments_v1-proto"></a>
<p align="right"><a href="#top">Top</a></p> <p align="right"><a href="#top">Top</a></p>
## proto/environments_v1.proto ## environments/environments_v1.proto
This file has messages for describing environments This file has messages for describing environments
@ -104,6 +113,113 @@ Service for handling environments
<a name="accounts_accounts_v1-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## accounts/accounts_v1.proto
This file has messages for describing environments
<a name="accounts-AccountData"></a>
### AccountData
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Account name |
<a name="accounts-AccountFull"></a>
### AccountFull
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [AccountId](#accounts-AccountId) | | |
| data | [AccountData](#accounts-AccountData) | | |
<a name="accounts-AccountId"></a>
### AccountId
Represents a environment UUID only
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | Contour ID: UUID |
<a name="accounts-AccountPassword"></a>
### AccountPassword
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Password | [string](#string) | | |
<a name="accounts-AccountWithPassword"></a>
### AccountWithPassword
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data | [AccountData](#accounts-AccountData) | | |
| AccountPassword | [AccountPassword](#accounts-AccountPassword) | | |
<a name="accounts-Accounts"></a>
### Accounts
Service for handling environments
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Create | [AccountData](#accounts-AccountData) | [AccountFull](#accounts-AccountFull) | |
| Update | [AccountFull](#accounts-AccountFull) | [AccountFull](#accounts-AccountFull) | |
| Delete | [AccountFull](#accounts-AccountFull) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| Get | [AccountId](#accounts-AccountId) | [AccountFull](#accounts-AccountFull) | |
| List | [.google.protobuf.Empty](#google-protobuf-Empty) | [AccountFull](#accounts-AccountFull) stream | |
## Scalar Value Types ## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |

View File

@ -0,0 +1,42 @@
/// This file has messages for describing environments
syntax = "proto3";
package accounts;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts";
/**
* Service for handling environments
*/
service Accounts {
rpc Create(AccountData) returns (AccountFull) {}
rpc Update(AccountFull) returns (AccountFull) {}
rpc Delete(AccountFull) returns (google.protobuf.Empty) {}
rpc Get(AccountId) returns (AccountFull) {}
rpc List(google.protobuf.Empty) returns (stream AccountFull) {}
}
/**
* Represents a environment UUID only
*/
message AccountId {
string id = 1; // Contour ID: UUID
}
message AccountPassword {
string Password = 1;
}
message AccountData {
string name = 1; // Account name
}
message AccountWithPassword {
AccountData data = 1;
AccountPassword AccountPassword = 2;
}
message AccountFull {
AccountId id = 1;
AccountData data = 2;
}