github.com/s7techlab/cckit@v0.10.5/examples/token/service/account/account.proto (about) 1 syntax = "proto3"; 2 3 option go_package = "github.com/s7techlab/cckit/examples/token/service/account"; 4 package examples.token.service.account; 5 6 import "google/api/annotations.proto"; 7 import "google/protobuf/empty.proto"; 8 9 // Account 10 service AccountService { 11 12 rpc GetInvokerAddress (google.protobuf.Empty) returns (AddressId) { 13 option (google.api.http) = { 14 get: "/token/addresses/whoami" 15 }; 16 } 17 18 rpc GetAddress (GetAddressRequest) returns (AddressId) { 19 option (google.api.http) = { 20 get: "/token/addresses/{public_key}" 21 }; 22 } 23 24 rpc GetAccount (AccountId) returns (Account) { 25 option (google.api.http) = { 26 get: "/token/accounts/{address}" 27 }; 28 } 29 30 } 31 32 message GetAddressRequest { 33 bytes public_key = 1; 34 } 35 36 message GetAccountRequest { 37 string address = 1; 38 } 39 40 message Address { 41 string address = 1; 42 } 43 44 message AddressId { 45 string address = 1; 46 } 47 48 message AccountId { 49 string address = 1; 50 } 51 52 message Account { 53 string address = 1; 54 AccountStatus status = 2; 55 } 56 57 message AccountKey { 58 bytes public_key = 1; 59 KeyStatus status = 2; 60 } 61 62 enum KeyStatus { 63 KEY_STATUS_UNKNOWN = 0; 64 KEY_STATUS_ENABLED = 1; 65 KEY_STATUS_DISABLED = 2; 66 } 67 68 enum AccountStatus { 69 ACCOUNT_STATUS_UNKNOWN = 0; 70 ACCOUNT_STATUS_ENABLED = 1; 71 ACCOUNT_STATUS_DISABLED = 2; 72 }