🎉 Initial Commit of Ring
This commit is contained in:
14
pkg/shared/models/base.go
Normal file
14
pkg/shared/models/base.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"created_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"created_at"`
|
||||
}
|
||||
499
pkg/shared/proto/account.proto
Normal file
499
pkg/shared/proto/account.proto
Normal file
@@ -0,0 +1,499 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
|
||||
import 'file.proto';
|
||||
import 'wallet.proto';
|
||||
|
||||
// Account represents a user account in the system
|
||||
message Account {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string nick = 3;
|
||||
string language = 4;
|
||||
string region = 18;
|
||||
google.protobuf.Timestamp activated_at = 5;
|
||||
bool is_superuser = 6;
|
||||
|
||||
AccountProfile profile = 7;
|
||||
optional SubscriptionReferenceObject perk_subscription = 16;
|
||||
repeated AccountContact contacts = 8;
|
||||
repeated AccountBadge badges = 9;
|
||||
repeated AccountAuthFactor auth_factors = 10;
|
||||
repeated AccountConnection connections = 11;
|
||||
repeated Relationship outgoing_relationships = 12;
|
||||
repeated Relationship incoming_relationships = 13;
|
||||
|
||||
google.protobuf.Timestamp created_at = 14;
|
||||
google.protobuf.Timestamp updated_at = 15;
|
||||
|
||||
google.protobuf.StringValue automated_id = 17;
|
||||
}
|
||||
|
||||
// Enum for status attitude
|
||||
enum StatusAttitude {
|
||||
STATUS_ATTITUDE_UNSPECIFIED = 0;
|
||||
POSITIVE = 1;
|
||||
NEGATIVE = 2;
|
||||
NEUTRAL = 3;
|
||||
}
|
||||
|
||||
// AccountStatus represents the status of an account
|
||||
message AccountStatus {
|
||||
string id = 1;
|
||||
StatusAttitude attitude = 2;
|
||||
bool is_online = 3;
|
||||
bool is_customized = 4;
|
||||
bool is_invisible = 5;
|
||||
bool is_not_disturb = 6;
|
||||
google.protobuf.StringValue label = 7;
|
||||
google.protobuf.Timestamp cleared_at = 8;
|
||||
string account_id = 9;
|
||||
bytes meta = 10;
|
||||
}
|
||||
|
||||
message UsernameColor {
|
||||
string type = 1;
|
||||
google.protobuf.StringValue value = 2;
|
||||
google.protobuf.StringValue direction = 3;
|
||||
repeated string colors = 4;
|
||||
}
|
||||
|
||||
message ProfileLink {
|
||||
string name = 1;
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
// Profile contains detailed information about a user
|
||||
message AccountProfile {
|
||||
string id = 1;
|
||||
google.protobuf.StringValue first_name = 2;
|
||||
google.protobuf.StringValue middle_name = 3;
|
||||
google.protobuf.StringValue last_name = 4;
|
||||
google.protobuf.StringValue bio = 5;
|
||||
google.protobuf.StringValue gender = 6;
|
||||
google.protobuf.StringValue pronouns = 7;
|
||||
google.protobuf.StringValue time_zone = 8;
|
||||
google.protobuf.StringValue location = 9;
|
||||
google.protobuf.Timestamp birthday = 10;
|
||||
google.protobuf.Timestamp last_seen_at = 11;
|
||||
|
||||
VerificationMark verification = 12;
|
||||
BadgeReferenceObject active_badge = 13;
|
||||
|
||||
int32 experience = 14;
|
||||
int32 level = 15;
|
||||
double leveling_progress = 16;
|
||||
double social_credits = 17;
|
||||
int32 social_credits_level = 18;
|
||||
|
||||
CloudFile picture = 19;
|
||||
CloudFile background = 20;
|
||||
|
||||
string account_id = 21;
|
||||
|
||||
google.protobuf.Timestamp created_at = 22;
|
||||
google.protobuf.Timestamp updated_at = 23;
|
||||
optional UsernameColor username_color = 24;
|
||||
repeated ProfileLink links = 25;
|
||||
}
|
||||
|
||||
// AccountContact represents a contact method for an account
|
||||
message AccountContact {
|
||||
string id = 1;
|
||||
AccountContactType type = 2;
|
||||
google.protobuf.Timestamp verified_at = 3;
|
||||
bool is_primary = 4;
|
||||
string content = 5;
|
||||
string account_id = 6;
|
||||
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
// Enum for contact types
|
||||
enum AccountContactType {
|
||||
ACCOUNT_CONTACT_TYPE_UNSPECIFIED = 0;
|
||||
EMAIL = 1;
|
||||
PHONE_NUMBER = 2;
|
||||
ADDRESS = 3;
|
||||
}
|
||||
|
||||
// AccountAuthFactor represents an authentication factor for an account
|
||||
message AccountAuthFactor {
|
||||
string id = 1;
|
||||
AccountAuthFactorType type = 2;
|
||||
google.protobuf.StringValue secret = 3; // Omitted from JSON serialization in original
|
||||
map<string, google.protobuf.Value> config = 4; // Omitted from JSON serialization in original
|
||||
int32 trustworthy = 5;
|
||||
google.protobuf.Timestamp enabled_at = 6;
|
||||
google.protobuf.Timestamp expired_at = 7;
|
||||
string account_id = 8;
|
||||
map<string, google.protobuf.Value> created_response = 9; // For initial setup
|
||||
|
||||
google.protobuf.Timestamp created_at = 10;
|
||||
google.protobuf.Timestamp updated_at = 11;
|
||||
}
|
||||
|
||||
// Enum for authentication factor types
|
||||
enum AccountAuthFactorType {
|
||||
AUTH_FACTOR_TYPE_UNSPECIFIED = 0;
|
||||
PASSWORD = 1;
|
||||
EMAIL_CODE = 2;
|
||||
IN_APP_CODE = 3;
|
||||
TIMED_CODE = 4;
|
||||
PIN_CODE = 5;
|
||||
}
|
||||
|
||||
// AccountBadge represents a badge associated with an account
|
||||
message AccountBadge {
|
||||
string id = 1; // Unique identifier for the badge
|
||||
string type = 2; // Type/category of the badge
|
||||
google.protobuf.StringValue label = 3; // Display name of the badge
|
||||
google.protobuf.StringValue caption = 4; // Optional description of the badge
|
||||
map<string, google.protobuf.Value> meta = 5; // Additional metadata for the badge
|
||||
google.protobuf.Timestamp activated_at = 6; // When the badge was activated
|
||||
google.protobuf.Timestamp expired_at = 7; // Optional expiration time
|
||||
string account_id = 8; // ID of the account this badge belongs to
|
||||
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
|
||||
// AccountConnection represents a third-party connection for an account
|
||||
message AccountConnection {
|
||||
string id = 1;
|
||||
string provider = 2;
|
||||
string provided_identifier = 3;
|
||||
map<string, google.protobuf.Value> meta = 4;
|
||||
google.protobuf.StringValue access_token = 5; // Omitted from JSON serialization
|
||||
google.protobuf.StringValue refresh_token = 6; // Omitted from JSON serialization
|
||||
google.protobuf.Timestamp last_used_at = 7;
|
||||
string account_id = 8;
|
||||
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
|
||||
// VerificationMark represents verification status
|
||||
message VerificationMark {
|
||||
VerificationMarkType type = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string verified_by = 4;
|
||||
|
||||
google.protobuf.Timestamp created_at = 5;
|
||||
google.protobuf.Timestamp updated_at = 6;
|
||||
}
|
||||
|
||||
enum VerificationMarkType {
|
||||
VERIFICATION_MARK_TYPE_UNSPECIFIED = 0;
|
||||
OFFICIAL = 1;
|
||||
INDIVIDUAL = 2;
|
||||
ORGANIZATION = 3;
|
||||
GOVERNMENT = 4;
|
||||
CREATOR = 5;
|
||||
DEVELOPER = 6;
|
||||
PARODY = 7;
|
||||
}
|
||||
|
||||
// BadgeReferenceObject represents a reference to a badge with minimal information
|
||||
message BadgeReferenceObject {
|
||||
string id = 1; // Unique identifier for the badge
|
||||
string type = 2; // Type/category of the badge
|
||||
google.protobuf.StringValue label = 3; // Display name of the badge
|
||||
google.protobuf.StringValue caption = 4; // Optional description of the badge
|
||||
map<string, google.protobuf.Value> meta = 5; // Additional metadata for the badge
|
||||
google.protobuf.Timestamp activated_at = 6; // When the badge was activated
|
||||
google.protobuf.Timestamp expired_at = 7; // Optional expiration time
|
||||
string account_id = 8; // ID of the account this badge belongs to
|
||||
}
|
||||
|
||||
// Relationship represents a connection between two accounts
|
||||
message Relationship {
|
||||
string account_id = 1;
|
||||
string related_id = 2;
|
||||
optional Account account = 3;
|
||||
optional Account related = 4;
|
||||
int32 status = 5;
|
||||
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
|
||||
// Leveling information
|
||||
message LevelingInfo {
|
||||
int32 current_level = 1;
|
||||
int32 current_experience = 2;
|
||||
int32 next_level_experience = 3;
|
||||
int32 previous_level_experience = 4;
|
||||
double level_progress = 5;
|
||||
repeated int32 experience_per_level = 6;
|
||||
}
|
||||
|
||||
// ActionLog represents a record of an action taken by a user
|
||||
message ActionLog {
|
||||
string id = 1; // Unique identifier for the log entry
|
||||
string action = 2; // The action that was performed, e.g., "user.login"
|
||||
map<string, google.protobuf.Value> meta = 3; // Metadata associated with the action
|
||||
google.protobuf.StringValue user_agent = 4; // User agent of the client
|
||||
google.protobuf.StringValue ip_address = 5; // IP address of the client
|
||||
google.protobuf.StringValue location = 6; // Geographic location of the client, derived from IP
|
||||
string account_id = 7; // The account that performed the action
|
||||
google.protobuf.StringValue session_id = 8; // The session in which the action was performed
|
||||
|
||||
google.protobuf.Timestamp created_at = 9; // When the action log was created
|
||||
}
|
||||
|
||||
message GetAccountStatusBatchResponse {
|
||||
repeated AccountStatus statuses = 1;
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Service Definitions
|
||||
// ====================================
|
||||
|
||||
// AccountService provides CRUD operations for user accounts and related entities
|
||||
service AccountService {
|
||||
// Account Operations
|
||||
rpc GetAccount(GetAccountRequest) returns (Account) {}
|
||||
rpc GetBotAccount(GetBotAccountRequest) returns (Account) {}
|
||||
rpc GetAccountBatch(GetAccountBatchRequest) returns (GetAccountBatchResponse) {}
|
||||
rpc GetBotAccountBatch(GetBotAccountBatchRequest) returns (GetAccountBatchResponse) {}
|
||||
rpc LookupAccountBatch(LookupAccountBatchRequest) returns (GetAccountBatchResponse) {}
|
||||
rpc SearchAccount(SearchAccountRequest) returns (GetAccountBatchResponse) {}
|
||||
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {}
|
||||
|
||||
rpc GetAccountStatus(GetAccountRequest) returns (AccountStatus) {}
|
||||
rpc GetAccountStatusBatch(GetAccountBatchRequest) returns (GetAccountStatusBatchResponse) {}
|
||||
|
||||
// Profile Operations
|
||||
rpc GetProfile(GetProfileRequest) returns (AccountProfile) {}
|
||||
|
||||
// Contact Operations
|
||||
rpc ListContacts(ListContactsRequest) returns (ListContactsResponse) {}
|
||||
|
||||
// Badge Operations
|
||||
rpc ListBadges(ListBadgesRequest) returns (ListBadgesResponse) {}
|
||||
|
||||
// Authentication Factor Operations
|
||||
rpc ListAuthFactors(ListAuthFactorsRequest) returns (ListAuthFactorsResponse) {}
|
||||
|
||||
// Connection Operations
|
||||
rpc ListConnections(ListConnectionsRequest) returns (ListConnectionsResponse) {}
|
||||
|
||||
// Relationship Operations
|
||||
rpc ListRelationships(ListRelationshipsRequest) returns (ListRelationshipsResponse) {}
|
||||
|
||||
rpc GetRelationship(GetRelationshipRequest) returns (GetRelationshipResponse) {}
|
||||
rpc HasRelationship(GetRelationshipRequest) returns (google.protobuf.BoolValue) {}
|
||||
rpc ListFriends(ListRelationshipSimpleRequest) returns (ListRelationshipSimpleResponse) {}
|
||||
rpc ListBlocked(ListRelationshipSimpleRequest) returns (ListRelationshipSimpleResponse) {}
|
||||
}
|
||||
|
||||
// ActionLogService provides operations for action logs
|
||||
service ActionLogService {
|
||||
rpc CreateActionLog(CreateActionLogRequest) returns (CreateActionLogResponse) {}
|
||||
rpc ListActionLogs(ListActionLogsRequest) returns (ListActionLogsResponse) {}
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Request/Response Messages
|
||||
// ====================================
|
||||
|
||||
// ActionLog Requests/Responses
|
||||
message CreateActionLogRequest {
|
||||
string action = 1;
|
||||
map<string, google.protobuf.Value> meta = 2;
|
||||
google.protobuf.StringValue user_agent = 3;
|
||||
google.protobuf.StringValue ip_address = 4;
|
||||
google.protobuf.StringValue location = 5;
|
||||
string account_id = 6;
|
||||
google.protobuf.StringValue session_id = 7;
|
||||
}
|
||||
|
||||
message CreateActionLogResponse {
|
||||
ActionLog action_log = 1;
|
||||
}
|
||||
|
||||
message ListActionLogsRequest {
|
||||
string account_id = 1;
|
||||
string action = 2;
|
||||
int32 page_size = 3;
|
||||
string page_token = 4;
|
||||
string order_by = 5;
|
||||
}
|
||||
|
||||
message ListActionLogsResponse {
|
||||
repeated ActionLog action_logs = 1;
|
||||
string next_page_token = 2;
|
||||
int32 total_size = 3;
|
||||
}
|
||||
|
||||
// Account Requests/Responses
|
||||
message GetAccountRequest {
|
||||
string id = 1; // Account ID to retrieve
|
||||
}
|
||||
|
||||
message GetBotAccountRequest {
|
||||
string automated_id = 1;
|
||||
}
|
||||
|
||||
message GetAccountBatchRequest {
|
||||
repeated string id = 1; // Account ID to retrieve
|
||||
}
|
||||
|
||||
message GetBotAccountBatchRequest {
|
||||
repeated string automated_id = 1;
|
||||
}
|
||||
|
||||
message LookupAccountBatchRequest {
|
||||
repeated string names = 1;
|
||||
}
|
||||
|
||||
message SearchAccountRequest {
|
||||
string query = 1;
|
||||
}
|
||||
|
||||
message GetAccountBatchResponse {
|
||||
repeated Account accounts = 1; // List of accounts
|
||||
}
|
||||
|
||||
message CreateAccountRequest {
|
||||
string name = 1; // Required: Unique username
|
||||
string nick = 2; // Optional: Display name
|
||||
string language = 3; // Default language
|
||||
bool is_superuser = 4; // Admin flag
|
||||
AccountProfile profile = 5; // Initial profile data
|
||||
}
|
||||
|
||||
message UpdateAccountRequest {
|
||||
string id = 1; // Account ID to update
|
||||
google.protobuf.StringValue name = 2; // New username if changing
|
||||
google.protobuf.StringValue nick = 3; // New display name
|
||||
google.protobuf.StringValue language = 4; // New language
|
||||
google.protobuf.BoolValue is_superuser = 5; // Admin status
|
||||
}
|
||||
|
||||
message DeleteAccountRequest {
|
||||
string id = 1; // Account ID to delete
|
||||
bool purge = 2; // If true, permanently delete instead of soft delete
|
||||
}
|
||||
|
||||
message ListAccountsRequest {
|
||||
int32 page_size = 1; // Number of results per page
|
||||
string page_token = 2; // Token for pagination
|
||||
string filter = 3; // Filter expression
|
||||
string order_by = 4; // Sort order
|
||||
}
|
||||
|
||||
message ListAccountsResponse {
|
||||
repeated Account accounts = 1; // List of accounts
|
||||
string next_page_token = 2; // Token for next page
|
||||
int32 total_size = 3; // Total number of accounts
|
||||
}
|
||||
|
||||
// Profile Requests/Responses
|
||||
message GetProfileRequest {
|
||||
string account_id = 1; // Account ID to get profile for
|
||||
}
|
||||
|
||||
message UpdateProfileRequest {
|
||||
string account_id = 1; // Account ID to update profile for
|
||||
AccountProfile profile = 2; // Profile data to update
|
||||
google.protobuf.FieldMask update_mask = 3; // Fields to update
|
||||
}
|
||||
|
||||
// Contact Requests/Responses
|
||||
message AddContactRequest {
|
||||
string account_id = 1; // Account to add contact to
|
||||
AccountContactType type = 2; // Type of contact
|
||||
string content = 3; // Contact content (email, phone, etc.)
|
||||
bool is_primary = 4; // If this should be the primary contact
|
||||
}
|
||||
|
||||
message ListContactsRequest {
|
||||
string account_id = 1; // Account ID to list contacts for
|
||||
AccountContactType type = 2; // Optional: filter by type
|
||||
bool verified_only = 3; // Only return verified contacts
|
||||
}
|
||||
|
||||
message ListContactsResponse {
|
||||
repeated AccountContact contacts = 1; // List of contacts
|
||||
}
|
||||
|
||||
message VerifyContactRequest {
|
||||
string id = 1; // Contact ID to verify
|
||||
string account_id = 2; // Account ID (for validation)
|
||||
string code = 3; // Verification code
|
||||
}
|
||||
|
||||
// Badge Requests/Responses
|
||||
message ListBadgesRequest {
|
||||
string account_id = 1; // Account to list badges for
|
||||
string type = 2; // Optional: filter by type
|
||||
bool active_only = 3; // Only return active (non-expired) badges
|
||||
}
|
||||
|
||||
message ListBadgesResponse {
|
||||
repeated AccountBadge badges = 1; // List of badges
|
||||
}
|
||||
|
||||
message ListAuthFactorsRequest {
|
||||
string account_id = 1; // Account to list factors for
|
||||
bool active_only = 2; // Only return active (non-expired) factors
|
||||
}
|
||||
|
||||
message ListAuthFactorsResponse {
|
||||
repeated AccountAuthFactor factors = 1; // List of auth factors
|
||||
}
|
||||
|
||||
message ListConnectionsRequest {
|
||||
string account_id = 1; // Account to list connections for
|
||||
string provider = 2; // Optional: filter by provider
|
||||
}
|
||||
|
||||
message ListConnectionsResponse {
|
||||
repeated AccountConnection connections = 1; // List of connections
|
||||
}
|
||||
|
||||
// Relationship Requests/Responses
|
||||
message ListRelationshipsRequest {
|
||||
string account_id = 1; // Account to list relationships for
|
||||
optional int32 status = 2; // Filter by status
|
||||
int32 page_size = 5; // Number of results per page
|
||||
string page_token = 6; // Token for pagination
|
||||
}
|
||||
|
||||
message ListRelationshipsResponse {
|
||||
repeated Relationship relationships = 1; // List of relationships
|
||||
string next_page_token = 2; // Token for next page
|
||||
int32 total_size = 3; // Total number of relationships
|
||||
}
|
||||
|
||||
message GetRelationshipRequest {
|
||||
string account_id = 1;
|
||||
string related_id = 2;
|
||||
optional int32 status = 3;
|
||||
}
|
||||
|
||||
message GetRelationshipResponse {
|
||||
optional Relationship relationship = 1;
|
||||
}
|
||||
|
||||
message ListRelationshipSimpleRequest {
|
||||
string account_id = 1;
|
||||
}
|
||||
|
||||
message ListRelationshipSimpleResponse {
|
||||
repeated string accounts_id = 1;
|
||||
}
|
||||
212
pkg/shared/proto/auth.proto
Normal file
212
pkg/shared/proto/auth.proto
Normal file
@@ -0,0 +1,212 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
|
||||
import "account.proto";
|
||||
|
||||
// Represents a user session
|
||||
message AuthSession {
|
||||
string id = 1;
|
||||
optional google.protobuf.Timestamp last_granted_at = 3;
|
||||
optional google.protobuf.Timestamp expired_at = 4;
|
||||
string account_id = 5;
|
||||
Account account = 6;
|
||||
google.protobuf.StringValue app_id = 9;
|
||||
optional string client_id = 10;
|
||||
optional string parent_session_id = 11;
|
||||
AuthClient client = 12;
|
||||
repeated string audiences = 13;
|
||||
repeated string scopes = 14;
|
||||
google.protobuf.StringValue ip_address = 15;
|
||||
google.protobuf.StringValue user_agent = 16;
|
||||
SessionType type = 17;
|
||||
}
|
||||
|
||||
// Represents an authentication challenge
|
||||
message AuthChallenge {
|
||||
string id = 1;
|
||||
google.protobuf.Timestamp expired_at = 2;
|
||||
int32 step_remain = 3;
|
||||
int32 step_total = 4;
|
||||
int32 failed_attempts = 5;
|
||||
repeated string blacklist_factors = 8;
|
||||
repeated string audiences = 9;
|
||||
repeated string scopes = 10;
|
||||
google.protobuf.StringValue ip_address = 11;
|
||||
google.protobuf.StringValue user_agent = 12;
|
||||
google.protobuf.StringValue device_id = 13;
|
||||
google.protobuf.StringValue nonce = 14;
|
||||
// Point location is omitted as there is no direct proto equivalent.
|
||||
string account_id = 15;
|
||||
google.protobuf.StringValue device_name = 16;
|
||||
ClientPlatform platform = 17;
|
||||
}
|
||||
|
||||
message AuthClient {
|
||||
string id = 1;
|
||||
ClientPlatform platform = 2;
|
||||
google.protobuf.StringValue device_name = 3;
|
||||
google.protobuf.StringValue device_label = 4;
|
||||
string device_id = 5;
|
||||
string account_id = 6;
|
||||
}
|
||||
|
||||
// Enum for challenge types
|
||||
enum SessionType {
|
||||
CHALLENGE_TYPE_UNSPECIFIED = 0;
|
||||
LOGIN = 1;
|
||||
OAUTH = 2;
|
||||
OIDC = 3;
|
||||
}
|
||||
|
||||
// Enum for client platforms
|
||||
enum ClientPlatform {
|
||||
CLIENT_PLATFORM_UNSPECIFIED = 0;
|
||||
UNIDENTIFIED = 1;
|
||||
WEB = 2;
|
||||
IOS = 3;
|
||||
ANDROID = 4;
|
||||
MACOS = 5;
|
||||
WINDOWS = 6;
|
||||
LINUX = 7;
|
||||
}
|
||||
|
||||
service AuthService {
|
||||
rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) {}
|
||||
|
||||
rpc ValidatePin(ValidatePinRequest) returns (ValidateResponse) {}
|
||||
rpc ValidateCaptcha(ValidateCaptchaRequest) returns (ValidateResponse) {}
|
||||
}
|
||||
|
||||
message AuthenticateRequest {
|
||||
string token = 1;
|
||||
optional google.protobuf.StringValue ip_address = 2;
|
||||
}
|
||||
|
||||
message AuthenticateResponse {
|
||||
bool valid = 1;
|
||||
optional string message = 2;
|
||||
optional AuthSession session = 3;
|
||||
}
|
||||
|
||||
message ValidatePinRequest {
|
||||
string account_id = 1;
|
||||
string pin = 2;
|
||||
}
|
||||
|
||||
message ValidateCaptchaRequest {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message ValidateResponse {
|
||||
bool valid = 1;
|
||||
}
|
||||
|
||||
enum PermissionNodeActorType {
|
||||
ACCOUNT = 0;
|
||||
GROUP = 1;
|
||||
}
|
||||
|
||||
// Permission related messages and services
|
||||
message PermissionNode {
|
||||
string id = 1;
|
||||
string actor = 2;
|
||||
PermissionNodeActorType type = 3;
|
||||
string key = 4;
|
||||
google.protobuf.Value value = 5; // Using Value to represent generic type
|
||||
google.protobuf.Timestamp expired_at = 6;
|
||||
google.protobuf.Timestamp affected_at = 7;
|
||||
string group_id = 8; // Optional group ID
|
||||
}
|
||||
|
||||
message PermissionGroup {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
google.protobuf.Timestamp created_at = 3;
|
||||
}
|
||||
|
||||
message HasPermissionRequest {
|
||||
string actor = 1;
|
||||
string key = 2;
|
||||
optional PermissionNodeActorType type = 3;
|
||||
}
|
||||
|
||||
message HasPermissionResponse {
|
||||
bool has_permission = 1;
|
||||
}
|
||||
|
||||
message GetPermissionRequest {
|
||||
string actor = 1;
|
||||
optional PermissionNodeActorType type = 2;
|
||||
string key = 3;
|
||||
}
|
||||
|
||||
message GetPermissionResponse {
|
||||
google.protobuf.Value value = 1; // Using Value to represent generic type
|
||||
}
|
||||
|
||||
message AddPermissionNodeRequest {
|
||||
string actor = 1;
|
||||
optional PermissionNodeActorType type = 2;
|
||||
string key = 3;
|
||||
google.protobuf.Value value = 4;
|
||||
google.protobuf.Timestamp expired_at = 5;
|
||||
google.protobuf.Timestamp affected_at = 6;
|
||||
}
|
||||
|
||||
message AddPermissionNodeResponse {
|
||||
PermissionNode node = 1;
|
||||
}
|
||||
|
||||
message AddPermissionNodeToGroupRequest {
|
||||
PermissionGroup group = 1;
|
||||
string actor = 2;
|
||||
optional PermissionNodeActorType type = 3;
|
||||
string key = 4;
|
||||
google.protobuf.Value value = 5;
|
||||
google.protobuf.Timestamp expired_at = 6;
|
||||
google.protobuf.Timestamp affected_at = 7;
|
||||
}
|
||||
|
||||
message AddPermissionNodeToGroupResponse {
|
||||
PermissionNode node = 1;
|
||||
}
|
||||
|
||||
message RemovePermissionNodeRequest {
|
||||
string actor = 1;
|
||||
optional PermissionNodeActorType type = 2;
|
||||
string key = 3;
|
||||
}
|
||||
|
||||
message RemovePermissionNodeResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message RemovePermissionNodeFromGroupRequest {
|
||||
PermissionGroup group = 1;
|
||||
string actor = 2;
|
||||
string key = 4;
|
||||
}
|
||||
|
||||
message RemovePermissionNodeFromGroupResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
service PermissionService {
|
||||
rpc HasPermission(HasPermissionRequest) returns (HasPermissionResponse) {}
|
||||
rpc GetPermission(GetPermissionRequest) returns (GetPermissionResponse) {}
|
||||
rpc AddPermissionNode(AddPermissionNodeRequest) returns (AddPermissionNodeResponse) {}
|
||||
rpc AddPermissionNodeToGroup(AddPermissionNodeToGroupRequest) returns (AddPermissionNodeToGroupResponse) {}
|
||||
rpc RemovePermissionNode(RemovePermissionNodeRequest) returns (RemovePermissionNodeResponse) {}
|
||||
rpc RemovePermissionNodeFromGroup(RemovePermissionNodeFromGroupRequest)
|
||||
returns (RemovePermissionNodeFromGroupResponse) {}
|
||||
}
|
||||
|
||||
187
pkg/shared/proto/develop.proto
Normal file
187
pkg/shared/proto/develop.proto
Normal file
@@ -0,0 +1,187 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "account.proto";
|
||||
import "file.proto";
|
||||
|
||||
message CustomAppOauthConfig {
|
||||
string client_uri = 1;
|
||||
repeated string redirect_uris = 2;
|
||||
repeated string post_logout_redirect_uris = 3;
|
||||
repeated string allowed_scopes = 4;
|
||||
repeated string allowed_grant_types = 5;
|
||||
bool require_pkce = 6;
|
||||
bool allow_offline_access = 7;
|
||||
}
|
||||
|
||||
message CustomAppLinks {
|
||||
string home_page = 1;
|
||||
string privacy_policy = 2;
|
||||
string terms_of_service = 3;
|
||||
}
|
||||
|
||||
enum CustomAppStatus {
|
||||
CUSTOM_APP_STATUS_UNSPECIFIED = 0;
|
||||
DEVELOPING = 1;
|
||||
STAGING = 2;
|
||||
PRODUCTION = 3;
|
||||
SUSPENDED = 4;
|
||||
}
|
||||
|
||||
message CustomApp {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
string name = 3;
|
||||
string description = 4;
|
||||
CustomAppStatus status = 5;
|
||||
|
||||
// jsonb columns represented as bytes
|
||||
CloudFile picture = 6;
|
||||
CloudFile background = 7;
|
||||
VerificationMark verification = 8;
|
||||
CustomAppLinks links = 9;
|
||||
CustomAppOauthConfig oauth_config = 13;
|
||||
|
||||
string project_id = 10;
|
||||
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
|
||||
message CustomAppSecret {
|
||||
string id = 1;
|
||||
string secret = 2;
|
||||
string description = 3;
|
||||
google.protobuf.Timestamp expired_at = 4;
|
||||
bool is_oidc = 5;
|
||||
|
||||
string app_id = 6;
|
||||
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
message GetCustomAppRequest {
|
||||
oneof Query {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message GetCustomAppResponse {
|
||||
CustomApp app = 1;
|
||||
}
|
||||
|
||||
message CheckCustomAppSecretRequest {
|
||||
oneof SecretIdentifier {
|
||||
string secret_id = 1;
|
||||
string app_id = 2;
|
||||
}
|
||||
string secret = 3;
|
||||
optional bool is_oidc = 4;
|
||||
}
|
||||
|
||||
message CheckCustomAppSecretResponse {
|
||||
bool valid = 1;
|
||||
}
|
||||
|
||||
service CustomAppService {
|
||||
rpc GetCustomApp(GetCustomAppRequest) returns (GetCustomAppResponse);
|
||||
rpc CheckCustomAppSecret(CheckCustomAppSecretRequest) returns (CheckCustomAppSecretResponse);
|
||||
}
|
||||
|
||||
// BotAccount represents a bot account in the system
|
||||
// It extends the base Account with bot-specific fields
|
||||
message BotAccount {
|
||||
// Base account information
|
||||
Account account = 1;
|
||||
|
||||
// Bot-specific information
|
||||
string slug = 2; // Unique identifier for the bot
|
||||
bool is_active = 3; // Whether the bot is currently active
|
||||
string automated_id = 5; // The bot ID
|
||||
|
||||
// Timestamps
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
|
||||
// Request/Response messages for BotAccount operations
|
||||
message CreateBotAccountRequest {
|
||||
Account account = 1;
|
||||
string automated_id = 2;
|
||||
google.protobuf.StringValue picture_id = 8;
|
||||
google.protobuf.StringValue background_id = 9;
|
||||
}
|
||||
|
||||
message CreateBotAccountResponse {
|
||||
BotAccount bot = 1; // The created bot account
|
||||
}
|
||||
|
||||
message UpdateBotAccountRequest {
|
||||
string automated_id = 1; // ID of the bot account to update
|
||||
Account account = 2; // Updated account information
|
||||
optional string picture_id = 8;
|
||||
optional string background_id = 9;
|
||||
}
|
||||
|
||||
message UpdateBotAccountResponse {
|
||||
BotAccount bot = 1; // The updated bot account
|
||||
}
|
||||
|
||||
message DeleteBotAccountRequest {
|
||||
string automated_id = 1; // ID of the bot account to delete
|
||||
bool force = 2; // Whether to force delete (bypass soft delete)
|
||||
}
|
||||
|
||||
message DeleteBotAccountResponse {
|
||||
bool success = 1; // Whether the deletion was successful
|
||||
}
|
||||
|
||||
message ApiKey {
|
||||
string id = 1;
|
||||
string label = 2;
|
||||
string account_id = 3;
|
||||
string session_id = 4;
|
||||
google.protobuf.StringValue key = 5;
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
|
||||
message GetApiKeyRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListApiKeyRequest {
|
||||
string automated_id = 1;
|
||||
}
|
||||
|
||||
message GetApiKeyBatchResponse {
|
||||
repeated ApiKey data = 1;
|
||||
}
|
||||
|
||||
message DeleteApiKeyResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
// This service should be implemented by the Pass service to handle the creation, update, and deletion of bot accounts
|
||||
service BotAccountReceiverService {
|
||||
rpc CreateBotAccount(CreateBotAccountRequest) returns (CreateBotAccountResponse);
|
||||
rpc UpdateBotAccount(UpdateBotAccountRequest) returns (UpdateBotAccountResponse);
|
||||
rpc DeleteBotAccount(DeleteBotAccountRequest) returns (DeleteBotAccountResponse);
|
||||
|
||||
rpc GetApiKey(GetApiKeyRequest) returns (ApiKey);
|
||||
rpc ListApiKey(ListApiKeyRequest) returns (GetApiKeyBatchResponse);
|
||||
rpc CreateApiKey(ApiKey) returns (ApiKey);
|
||||
rpc UpdateApiKey(ApiKey) returns (ApiKey);
|
||||
rpc RotateApiKey(GetApiKeyRequest) returns (ApiKey);
|
||||
rpc DeleteApiKey(GetApiKeyRequest) returns (DeleteApiKeyResponse);
|
||||
}
|
||||
|
||||
304
pkg/shared/proto/file.proto
Normal file
304
pkg/shared/proto/file.proto
Normal file
@@ -0,0 +1,304 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
// CloudFile represents a reference to a file stored in cloud storage.
|
||||
// It contains metadata about the file that won't change, helping to reduce database load.
|
||||
message CloudFile {
|
||||
// Unique identifier for the file
|
||||
string id = 1;
|
||||
|
||||
// Original name of the file
|
||||
string name = 2;
|
||||
|
||||
// The metadata uses JSON bytes to store to keep the data structure over gRPC
|
||||
// File metadata (e.g., dimensions, duration, etc.)
|
||||
bytes file_meta = 3;
|
||||
// User-defined metadata
|
||||
bytes user_meta = 4;
|
||||
optional bytes sensitive_marks = 12;
|
||||
|
||||
// MIME type of the file
|
||||
string mime_type = 5;
|
||||
|
||||
// File content hash (e.g., MD5, SHA-256)
|
||||
string hash = 6;
|
||||
|
||||
// File size in bytes
|
||||
int64 size = 7;
|
||||
|
||||
// Indicates if the file is stored with compression
|
||||
bool has_compression = 8;
|
||||
|
||||
// URL to access the file
|
||||
string url = 9;
|
||||
|
||||
// Content type of the file
|
||||
string content_type = 10;
|
||||
|
||||
// When the file was uploaded
|
||||
google.protobuf.Timestamp uploaded_at = 11;
|
||||
}
|
||||
|
||||
// Service for file operations
|
||||
service FileService {
|
||||
// Get file reference by ID
|
||||
rpc GetFile(GetFileRequest) returns (CloudFile);
|
||||
rpc GetFileBatch(GetFileBatchRequest) returns (GetFileBatchResponse);
|
||||
|
||||
// Update an existing file reference
|
||||
rpc UpdateFile(UpdateFileRequest) returns (CloudFile);
|
||||
|
||||
// Delete a file reference
|
||||
rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty);
|
||||
|
||||
// Load files from references
|
||||
rpc LoadFromReference(LoadFromReferenceRequest) returns (LoadFromReferenceResponse);
|
||||
|
||||
// Check if a file is referenced by any resource
|
||||
rpc IsReferenced(IsReferencedRequest) returns (IsReferencedResponse);
|
||||
|
||||
// Purge cache for a file
|
||||
rpc PurgeCache(PurgeCacheRequest) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
// Request message for GetFile
|
||||
message GetFileRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetFileBatchRequest {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
message GetFileBatchResponse {
|
||||
repeated CloudFile files = 1;
|
||||
}
|
||||
|
||||
// Request message for UpdateFile
|
||||
message UpdateFileRequest {
|
||||
CloudFile file = 1;
|
||||
google.protobuf.FieldMask update_mask = 2;
|
||||
}
|
||||
|
||||
message FileMetadata {
|
||||
string file_id = 1;
|
||||
string file_name = 2;
|
||||
string content_type = 3;
|
||||
string account_id = 4;
|
||||
}
|
||||
|
||||
message UploadMetadata {
|
||||
string file_id = 1;
|
||||
string target_remote = 2;
|
||||
string suffix = 3;
|
||||
string content_type = 4;
|
||||
}
|
||||
|
||||
message DeleteFileRequest {
|
||||
string id = 1;
|
||||
bool purge = 2;
|
||||
}
|
||||
|
||||
message LoadFromReferenceRequest {
|
||||
repeated string reference_ids = 1;
|
||||
}
|
||||
|
||||
message LoadFromReferenceResponse {
|
||||
repeated CloudFile files = 1;
|
||||
}
|
||||
|
||||
message GetReferenceCountRequest {
|
||||
string file_id = 1;
|
||||
}
|
||||
|
||||
message GetReferenceCountResponse {
|
||||
int32 count = 1;
|
||||
}
|
||||
|
||||
message IsReferencedRequest {
|
||||
string file_id = 1;
|
||||
}
|
||||
|
||||
message IsReferencedResponse {
|
||||
bool is_referenced = 1;
|
||||
}
|
||||
|
||||
message PurgeCacheRequest {
|
||||
string file_id = 1;
|
||||
}
|
||||
|
||||
// CloudFileReference represents a reference to a CloudFile with additional metadata
|
||||
// about its usage in the system.
|
||||
message CloudFileReference {
|
||||
// Unique identifier for the reference
|
||||
string id = 1;
|
||||
|
||||
// Reference to the actual file
|
||||
string file_id = 2;
|
||||
|
||||
// The actual file data (optional, can be populated when needed)
|
||||
CloudFile file = 3;
|
||||
|
||||
// Description of how this file is being used
|
||||
string usage = 4;
|
||||
|
||||
// ID of the resource that this file is associated with
|
||||
string resource_id = 5;
|
||||
|
||||
// Optional expiration timestamp for the reference
|
||||
google.protobuf.Timestamp expired_at = 6;
|
||||
}
|
||||
|
||||
// Request/Response messages for FileReferenceService
|
||||
message CreateReferenceRequest {
|
||||
string file_id = 1;
|
||||
string usage = 2;
|
||||
string resource_id = 3;
|
||||
optional google.protobuf.Timestamp expired_at = 4;
|
||||
optional google.protobuf.Duration duration = 5; // Alternative to expired_at
|
||||
}
|
||||
|
||||
message CreateReferenceBatchRequest {
|
||||
repeated string files_id = 1;
|
||||
string usage = 2;
|
||||
string resource_id = 3;
|
||||
optional google.protobuf.Timestamp expired_at = 4;
|
||||
optional google.protobuf.Duration duration = 5; // Alternative to expired_at
|
||||
}
|
||||
|
||||
message CreateReferenceBatchResponse {
|
||||
repeated CloudFileReference references = 1;
|
||||
}
|
||||
|
||||
message GetReferencesRequest {
|
||||
string file_id = 1;
|
||||
}
|
||||
|
||||
message GetReferencesResponse {
|
||||
repeated CloudFileReference references = 1;
|
||||
}
|
||||
|
||||
message GetResourceReferencesRequest {
|
||||
string resource_id = 1;
|
||||
string usage = 2; // Optional
|
||||
}
|
||||
|
||||
message GetResourceFilesRequest {
|
||||
string resource_id = 1;
|
||||
optional string usage = 2;
|
||||
}
|
||||
|
||||
message GetResourceFilesResponse {
|
||||
repeated CloudFile files = 1;
|
||||
}
|
||||
|
||||
message DeleteResourceReferencesRequest {
|
||||
string resource_id = 1;
|
||||
optional string usage = 2;
|
||||
}
|
||||
|
||||
message DeleteResourceReferencesBatchRequest {
|
||||
repeated string resource_ids = 1;
|
||||
optional string usage = 2;
|
||||
}
|
||||
|
||||
message DeleteResourceReferencesResponse {
|
||||
int32 deleted_count = 1;
|
||||
}
|
||||
|
||||
message DeleteReferenceRequest {
|
||||
string reference_id = 1;
|
||||
}
|
||||
|
||||
message DeleteReferenceResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message UpdateResourceFilesRequest {
|
||||
string resource_id = 1;
|
||||
repeated string file_ids = 2;
|
||||
string usage = 3;
|
||||
google.protobuf.Timestamp expired_at = 4;
|
||||
google.protobuf.Duration duration = 5; // Alternative to expired_at
|
||||
}
|
||||
|
||||
message UpdateResourceFilesResponse {
|
||||
repeated CloudFileReference references = 1;
|
||||
}
|
||||
|
||||
message SetReferenceExpirationRequest {
|
||||
string reference_id = 1;
|
||||
google.protobuf.Timestamp expired_at = 2;
|
||||
google.protobuf.Duration duration = 3; // Alternative to expired_at
|
||||
}
|
||||
|
||||
message SetReferenceExpirationResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message SetFileReferencesExpirationRequest {
|
||||
string file_id = 1;
|
||||
google.protobuf.Timestamp expired_at = 2;
|
||||
}
|
||||
|
||||
message SetFileReferencesExpirationResponse {
|
||||
int32 updated_count = 1;
|
||||
}
|
||||
|
||||
message HasFileReferencesRequest {
|
||||
string file_id = 1;
|
||||
}
|
||||
|
||||
message HasFileReferencesResponse {
|
||||
bool has_references = 1;
|
||||
}
|
||||
|
||||
// Service for managing file references
|
||||
service FileReferenceService {
|
||||
// Creates a new reference to a file for a specific resource
|
||||
rpc CreateReference(CreateReferenceRequest) returns (CloudFileReference);
|
||||
rpc CreateReferenceBatch(CreateReferenceBatchRequest) returns (CreateReferenceBatchResponse);
|
||||
|
||||
// Gets all references to a file
|
||||
rpc GetReferences(GetReferencesRequest) returns (GetReferencesResponse);
|
||||
|
||||
// Gets the number of references to a file
|
||||
rpc GetReferenceCount(GetReferenceCountRequest) returns (GetReferenceCountResponse);
|
||||
|
||||
// Gets all references for a specific resource and optional usage
|
||||
rpc GetResourceReferences(GetResourceReferencesRequest) returns (GetReferencesResponse);
|
||||
|
||||
// Gets all files referenced by a resource with optional usage filter
|
||||
rpc GetResourceFiles(GetResourceFilesRequest) returns (GetResourceFilesResponse);
|
||||
|
||||
// Deletes references for a specific resource and optional usage
|
||||
rpc DeleteResourceReferences(DeleteResourceReferencesRequest) returns (DeleteResourceReferencesResponse);
|
||||
|
||||
// Deletes references for multiple specific resources and optional usage
|
||||
rpc DeleteResourceReferencesBatch(DeleteResourceReferencesBatchRequest) returns (DeleteResourceReferencesResponse);
|
||||
|
||||
// Deletes a specific file reference
|
||||
rpc DeleteReference(DeleteReferenceRequest) returns (DeleteReferenceResponse);
|
||||
|
||||
// Updates the files referenced by a resource
|
||||
rpc UpdateResourceFiles(UpdateResourceFilesRequest) returns (UpdateResourceFilesResponse);
|
||||
|
||||
// Updates the expiration time for a file reference
|
||||
rpc SetReferenceExpiration(SetReferenceExpirationRequest) returns (SetReferenceExpirationResponse);
|
||||
|
||||
// Updates the expiration time for all references to a file
|
||||
rpc SetFileReferencesExpiration(SetFileReferencesExpirationRequest) returns (SetFileReferencesExpirationResponse);
|
||||
|
||||
// Checks if a file has any references
|
||||
rpc HasFileReferences(HasFileReferencesRequest) returns (HasFileReferencesResponse);
|
||||
}
|
||||
4474
pkg/shared/proto/gen/account.pb.go
Normal file
4474
pkg/shared/proto/gen/account.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
968
pkg/shared/proto/gen/account_grpc.pb.go
Normal file
968
pkg/shared/proto/gen/account_grpc.pb.go
Normal file
@@ -0,0 +1,968 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: account.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AccountService_GetAccount_FullMethodName = "/proto.AccountService/GetAccount"
|
||||
AccountService_GetBotAccount_FullMethodName = "/proto.AccountService/GetBotAccount"
|
||||
AccountService_GetAccountBatch_FullMethodName = "/proto.AccountService/GetAccountBatch"
|
||||
AccountService_GetBotAccountBatch_FullMethodName = "/proto.AccountService/GetBotAccountBatch"
|
||||
AccountService_LookupAccountBatch_FullMethodName = "/proto.AccountService/LookupAccountBatch"
|
||||
AccountService_SearchAccount_FullMethodName = "/proto.AccountService/SearchAccount"
|
||||
AccountService_ListAccounts_FullMethodName = "/proto.AccountService/ListAccounts"
|
||||
AccountService_GetAccountStatus_FullMethodName = "/proto.AccountService/GetAccountStatus"
|
||||
AccountService_GetAccountStatusBatch_FullMethodName = "/proto.AccountService/GetAccountStatusBatch"
|
||||
AccountService_GetProfile_FullMethodName = "/proto.AccountService/GetProfile"
|
||||
AccountService_ListContacts_FullMethodName = "/proto.AccountService/ListContacts"
|
||||
AccountService_ListBadges_FullMethodName = "/proto.AccountService/ListBadges"
|
||||
AccountService_ListAuthFactors_FullMethodName = "/proto.AccountService/ListAuthFactors"
|
||||
AccountService_ListConnections_FullMethodName = "/proto.AccountService/ListConnections"
|
||||
AccountService_ListRelationships_FullMethodName = "/proto.AccountService/ListRelationships"
|
||||
AccountService_GetRelationship_FullMethodName = "/proto.AccountService/GetRelationship"
|
||||
AccountService_HasRelationship_FullMethodName = "/proto.AccountService/HasRelationship"
|
||||
AccountService_ListFriends_FullMethodName = "/proto.AccountService/ListFriends"
|
||||
AccountService_ListBlocked_FullMethodName = "/proto.AccountService/ListBlocked"
|
||||
)
|
||||
|
||||
// AccountServiceClient is the client API for AccountService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// AccountService provides CRUD operations for user accounts and related entities
|
||||
type AccountServiceClient interface {
|
||||
// Account Operations
|
||||
GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*Account, error)
|
||||
GetBotAccount(ctx context.Context, in *GetBotAccountRequest, opts ...grpc.CallOption) (*Account, error)
|
||||
GetAccountBatch(ctx context.Context, in *GetAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error)
|
||||
GetBotAccountBatch(ctx context.Context, in *GetBotAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error)
|
||||
LookupAccountBatch(ctx context.Context, in *LookupAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error)
|
||||
SearchAccount(ctx context.Context, in *SearchAccountRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error)
|
||||
ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error)
|
||||
GetAccountStatus(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*AccountStatus, error)
|
||||
GetAccountStatusBatch(ctx context.Context, in *GetAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountStatusBatchResponse, error)
|
||||
// Profile Operations
|
||||
GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*AccountProfile, error)
|
||||
// Contact Operations
|
||||
ListContacts(ctx context.Context, in *ListContactsRequest, opts ...grpc.CallOption) (*ListContactsResponse, error)
|
||||
// Badge Operations
|
||||
ListBadges(ctx context.Context, in *ListBadgesRequest, opts ...grpc.CallOption) (*ListBadgesResponse, error)
|
||||
// Authentication Factor Operations
|
||||
ListAuthFactors(ctx context.Context, in *ListAuthFactorsRequest, opts ...grpc.CallOption) (*ListAuthFactorsResponse, error)
|
||||
// Connection Operations
|
||||
ListConnections(ctx context.Context, in *ListConnectionsRequest, opts ...grpc.CallOption) (*ListConnectionsResponse, error)
|
||||
// Relationship Operations
|
||||
ListRelationships(ctx context.Context, in *ListRelationshipsRequest, opts ...grpc.CallOption) (*ListRelationshipsResponse, error)
|
||||
GetRelationship(ctx context.Context, in *GetRelationshipRequest, opts ...grpc.CallOption) (*GetRelationshipResponse, error)
|
||||
HasRelationship(ctx context.Context, in *GetRelationshipRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
ListFriends(ctx context.Context, in *ListRelationshipSimpleRequest, opts ...grpc.CallOption) (*ListRelationshipSimpleResponse, error)
|
||||
ListBlocked(ctx context.Context, in *ListRelationshipSimpleRequest, opts ...grpc.CallOption) (*ListRelationshipSimpleResponse, error)
|
||||
}
|
||||
|
||||
type accountServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient {
|
||||
return &accountServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*Account, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Account)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetBotAccount(ctx context.Context, in *GetBotAccountRequest, opts ...grpc.CallOption) (*Account, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Account)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetBotAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetAccountBatch(ctx context.Context, in *GetAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAccountBatchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetAccountBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetBotAccountBatch(ctx context.Context, in *GetBotAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAccountBatchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetBotAccountBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) LookupAccountBatch(ctx context.Context, in *LookupAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAccountBatchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_LookupAccountBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) SearchAccount(ctx context.Context, in *SearchAccountRequest, opts ...grpc.CallOption) (*GetAccountBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAccountBatchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_SearchAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListAccounts(ctx context.Context, in *ListAccountsRequest, opts ...grpc.CallOption) (*ListAccountsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListAccountsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListAccounts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetAccountStatus(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*AccountStatus, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AccountStatus)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetAccountStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetAccountStatusBatch(ctx context.Context, in *GetAccountBatchRequest, opts ...grpc.CallOption) (*GetAccountStatusBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAccountStatusBatchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetAccountStatusBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*AccountProfile, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AccountProfile)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetProfile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListContacts(ctx context.Context, in *ListContactsRequest, opts ...grpc.CallOption) (*ListContactsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListContactsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListContacts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListBadges(ctx context.Context, in *ListBadgesRequest, opts ...grpc.CallOption) (*ListBadgesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListBadgesResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListBadges_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListAuthFactors(ctx context.Context, in *ListAuthFactorsRequest, opts ...grpc.CallOption) (*ListAuthFactorsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListAuthFactorsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListAuthFactors_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListConnections(ctx context.Context, in *ListConnectionsRequest, opts ...grpc.CallOption) (*ListConnectionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListConnectionsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListConnections_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListRelationships(ctx context.Context, in *ListRelationshipsRequest, opts ...grpc.CallOption) (*ListRelationshipsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRelationshipsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListRelationships_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetRelationship(ctx context.Context, in *GetRelationshipRequest, opts ...grpc.CallOption) (*GetRelationshipResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetRelationshipResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetRelationship_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) HasRelationship(ctx context.Context, in *GetRelationshipRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(wrapperspb.BoolValue)
|
||||
err := c.cc.Invoke(ctx, AccountService_HasRelationship_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListFriends(ctx context.Context, in *ListRelationshipSimpleRequest, opts ...grpc.CallOption) (*ListRelationshipSimpleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRelationshipSimpleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListFriends_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListBlocked(ctx context.Context, in *ListRelationshipSimpleRequest, opts ...grpc.CallOption) (*ListRelationshipSimpleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRelationshipSimpleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListBlocked_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AccountServiceServer is the server API for AccountService service.
|
||||
// All implementations must embed UnimplementedAccountServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// AccountService provides CRUD operations for user accounts and related entities
|
||||
type AccountServiceServer interface {
|
||||
// Account Operations
|
||||
GetAccount(context.Context, *GetAccountRequest) (*Account, error)
|
||||
GetBotAccount(context.Context, *GetBotAccountRequest) (*Account, error)
|
||||
GetAccountBatch(context.Context, *GetAccountBatchRequest) (*GetAccountBatchResponse, error)
|
||||
GetBotAccountBatch(context.Context, *GetBotAccountBatchRequest) (*GetAccountBatchResponse, error)
|
||||
LookupAccountBatch(context.Context, *LookupAccountBatchRequest) (*GetAccountBatchResponse, error)
|
||||
SearchAccount(context.Context, *SearchAccountRequest) (*GetAccountBatchResponse, error)
|
||||
ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error)
|
||||
GetAccountStatus(context.Context, *GetAccountRequest) (*AccountStatus, error)
|
||||
GetAccountStatusBatch(context.Context, *GetAccountBatchRequest) (*GetAccountStatusBatchResponse, error)
|
||||
// Profile Operations
|
||||
GetProfile(context.Context, *GetProfileRequest) (*AccountProfile, error)
|
||||
// Contact Operations
|
||||
ListContacts(context.Context, *ListContactsRequest) (*ListContactsResponse, error)
|
||||
// Badge Operations
|
||||
ListBadges(context.Context, *ListBadgesRequest) (*ListBadgesResponse, error)
|
||||
// Authentication Factor Operations
|
||||
ListAuthFactors(context.Context, *ListAuthFactorsRequest) (*ListAuthFactorsResponse, error)
|
||||
// Connection Operations
|
||||
ListConnections(context.Context, *ListConnectionsRequest) (*ListConnectionsResponse, error)
|
||||
// Relationship Operations
|
||||
ListRelationships(context.Context, *ListRelationshipsRequest) (*ListRelationshipsResponse, error)
|
||||
GetRelationship(context.Context, *GetRelationshipRequest) (*GetRelationshipResponse, error)
|
||||
HasRelationship(context.Context, *GetRelationshipRequest) (*wrapperspb.BoolValue, error)
|
||||
ListFriends(context.Context, *ListRelationshipSimpleRequest) (*ListRelationshipSimpleResponse, error)
|
||||
ListBlocked(context.Context, *ListRelationshipSimpleRequest) (*ListRelationshipSimpleResponse, error)
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAccountServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAccountServiceServer struct{}
|
||||
|
||||
func (UnimplementedAccountServiceServer) GetAccount(context.Context, *GetAccountRequest) (*Account, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetBotAccount(context.Context, *GetBotAccountRequest) (*Account, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetBotAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetAccountBatch(context.Context, *GetAccountBatchRequest) (*GetAccountBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAccountBatch not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetBotAccountBatch(context.Context, *GetBotAccountBatchRequest) (*GetAccountBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetBotAccountBatch not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) LookupAccountBatch(context.Context, *LookupAccountBatchRequest) (*GetAccountBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LookupAccountBatch not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SearchAccount(context.Context, *SearchAccountRequest) (*GetAccountBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListAccounts(context.Context, *ListAccountsRequest) (*ListAccountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListAccounts not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetAccountStatus(context.Context, *GetAccountRequest) (*AccountStatus, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAccountStatus not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetAccountStatusBatch(context.Context, *GetAccountBatchRequest) (*GetAccountStatusBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAccountStatusBatch not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetProfile(context.Context, *GetProfileRequest) (*AccountProfile, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListContacts(context.Context, *ListContactsRequest) (*ListContactsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListContacts not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListBadges(context.Context, *ListBadgesRequest) (*ListBadgesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListBadges not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListAuthFactors(context.Context, *ListAuthFactorsRequest) (*ListAuthFactorsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListAuthFactors not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListConnections(context.Context, *ListConnectionsRequest) (*ListConnectionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListConnections not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListRelationships(context.Context, *ListRelationshipsRequest) (*ListRelationshipsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListRelationships not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GetRelationship(context.Context, *GetRelationshipRequest) (*GetRelationshipResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetRelationship not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) HasRelationship(context.Context, *GetRelationshipRequest) (*wrapperspb.BoolValue, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HasRelationship not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListFriends(context.Context, *ListRelationshipSimpleRequest) (*ListRelationshipSimpleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListFriends not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListBlocked(context.Context, *ListRelationshipSimpleRequest) (*ListRelationshipSimpleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListBlocked not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
||||
func (UnimplementedAccountServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AccountServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAccountServiceServer interface {
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAccountServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AccountService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AccountService_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetAccount(ctx, req.(*GetAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetBotAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBotAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetBotAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetBotAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetBotAccount(ctx, req.(*GetBotAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetAccountBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetAccountBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetAccountBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetAccountBatch(ctx, req.(*GetAccountBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetBotAccountBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBotAccountBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetBotAccountBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetBotAccountBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetBotAccountBatch(ctx, req.(*GetBotAccountBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_LookupAccountBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupAccountBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).LookupAccountBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_LookupAccountBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).LookupAccountBatch(ctx, req.(*LookupAccountBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_SearchAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).SearchAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_SearchAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).SearchAccount(ctx, req.(*SearchAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListAccountsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListAccounts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListAccounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListAccounts(ctx, req.(*ListAccountsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetAccountStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetAccountStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetAccountStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetAccountStatus(ctx, req.(*GetAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetAccountStatusBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAccountBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetAccountStatusBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetAccountStatusBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetAccountStatusBatch(ctx, req.(*GetAccountBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetProfileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetProfile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetProfile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListContacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListContactsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListContacts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListContacts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListContacts(ctx, req.(*ListContactsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListBadges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListBadgesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListBadges(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListBadges_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListBadges(ctx, req.(*ListBadgesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListAuthFactors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListAuthFactorsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListAuthFactors(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListAuthFactors_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListAuthFactors(ctx, req.(*ListAuthFactorsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListConnectionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListConnections(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListConnections_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListConnections(ctx, req.(*ListConnectionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListRelationships_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListRelationshipsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListRelationships(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListRelationships_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListRelationships(ctx, req.(*ListRelationshipsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GetRelationship_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRelationshipRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetRelationship(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetRelationship_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetRelationship(ctx, req.(*GetRelationshipRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_HasRelationship_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRelationshipRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).HasRelationship(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_HasRelationship_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).HasRelationship(ctx, req.(*GetRelationshipRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListFriends_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListRelationshipSimpleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListFriends(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListFriends_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListFriends(ctx, req.(*ListRelationshipSimpleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListBlocked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListRelationshipSimpleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListBlocked(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListBlocked_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListBlocked(ctx, req.(*ListRelationshipSimpleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.AccountService",
|
||||
HandlerType: (*AccountServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetAccount",
|
||||
Handler: _AccountService_GetAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBotAccount",
|
||||
Handler: _AccountService_GetBotAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAccountBatch",
|
||||
Handler: _AccountService_GetAccountBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBotAccountBatch",
|
||||
Handler: _AccountService_GetBotAccountBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LookupAccountBatch",
|
||||
Handler: _AccountService_LookupAccountBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SearchAccount",
|
||||
Handler: _AccountService_SearchAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListAccounts",
|
||||
Handler: _AccountService_ListAccounts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAccountStatus",
|
||||
Handler: _AccountService_GetAccountStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAccountStatusBatch",
|
||||
Handler: _AccountService_GetAccountStatusBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetProfile",
|
||||
Handler: _AccountService_GetProfile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListContacts",
|
||||
Handler: _AccountService_ListContacts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListBadges",
|
||||
Handler: _AccountService_ListBadges_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListAuthFactors",
|
||||
Handler: _AccountService_ListAuthFactors_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListConnections",
|
||||
Handler: _AccountService_ListConnections_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListRelationships",
|
||||
Handler: _AccountService_ListRelationships_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRelationship",
|
||||
Handler: _AccountService_GetRelationship_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HasRelationship",
|
||||
Handler: _AccountService_HasRelationship_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListFriends",
|
||||
Handler: _AccountService_ListFriends_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListBlocked",
|
||||
Handler: _AccountService_ListBlocked_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "account.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
ActionLogService_CreateActionLog_FullMethodName = "/proto.ActionLogService/CreateActionLog"
|
||||
ActionLogService_ListActionLogs_FullMethodName = "/proto.ActionLogService/ListActionLogs"
|
||||
)
|
||||
|
||||
// ActionLogServiceClient is the client API for ActionLogService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// ActionLogService provides operations for action logs
|
||||
type ActionLogServiceClient interface {
|
||||
CreateActionLog(ctx context.Context, in *CreateActionLogRequest, opts ...grpc.CallOption) (*CreateActionLogResponse, error)
|
||||
ListActionLogs(ctx context.Context, in *ListActionLogsRequest, opts ...grpc.CallOption) (*ListActionLogsResponse, error)
|
||||
}
|
||||
|
||||
type actionLogServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewActionLogServiceClient(cc grpc.ClientConnInterface) ActionLogServiceClient {
|
||||
return &actionLogServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *actionLogServiceClient) CreateActionLog(ctx context.Context, in *CreateActionLogRequest, opts ...grpc.CallOption) (*CreateActionLogResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateActionLogResponse)
|
||||
err := c.cc.Invoke(ctx, ActionLogService_CreateActionLog_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *actionLogServiceClient) ListActionLogs(ctx context.Context, in *ListActionLogsRequest, opts ...grpc.CallOption) (*ListActionLogsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListActionLogsResponse)
|
||||
err := c.cc.Invoke(ctx, ActionLogService_ListActionLogs_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ActionLogServiceServer is the server API for ActionLogService service.
|
||||
// All implementations must embed UnimplementedActionLogServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// ActionLogService provides operations for action logs
|
||||
type ActionLogServiceServer interface {
|
||||
CreateActionLog(context.Context, *CreateActionLogRequest) (*CreateActionLogResponse, error)
|
||||
ListActionLogs(context.Context, *ListActionLogsRequest) (*ListActionLogsResponse, error)
|
||||
mustEmbedUnimplementedActionLogServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedActionLogServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedActionLogServiceServer struct{}
|
||||
|
||||
func (UnimplementedActionLogServiceServer) CreateActionLog(context.Context, *CreateActionLogRequest) (*CreateActionLogResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateActionLog not implemented")
|
||||
}
|
||||
func (UnimplementedActionLogServiceServer) ListActionLogs(context.Context, *ListActionLogsRequest) (*ListActionLogsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListActionLogs not implemented")
|
||||
}
|
||||
func (UnimplementedActionLogServiceServer) mustEmbedUnimplementedActionLogServiceServer() {}
|
||||
func (UnimplementedActionLogServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeActionLogServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ActionLogServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeActionLogServiceServer interface {
|
||||
mustEmbedUnimplementedActionLogServiceServer()
|
||||
}
|
||||
|
||||
func RegisterActionLogServiceServer(s grpc.ServiceRegistrar, srv ActionLogServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedActionLogServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ActionLogService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ActionLogService_CreateActionLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateActionLogRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ActionLogServiceServer).CreateActionLog(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ActionLogService_CreateActionLog_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ActionLogServiceServer).CreateActionLog(ctx, req.(*CreateActionLogRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ActionLogService_ListActionLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListActionLogsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ActionLogServiceServer).ListActionLogs(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ActionLogService_ListActionLogs_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ActionLogServiceServer).ListActionLogs(ctx, req.(*ListActionLogsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ActionLogService_ServiceDesc is the grpc.ServiceDesc for ActionLogService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ActionLogService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.ActionLogService",
|
||||
HandlerType: (*ActionLogServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateActionLog",
|
||||
Handler: _ActionLogService_CreateActionLog_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListActionLogs",
|
||||
Handler: _ActionLogService_ListActionLogs_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "account.proto",
|
||||
}
|
||||
2002
pkg/shared/proto/gen/auth.pb.go
Normal file
2002
pkg/shared/proto/gen/auth.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
489
pkg/shared/proto/gen/auth_grpc.pb.go
Normal file
489
pkg/shared/proto/gen/auth_grpc.pb.go
Normal file
@@ -0,0 +1,489 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: auth.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuthService_Authenticate_FullMethodName = "/proto.AuthService/Authenticate"
|
||||
AuthService_ValidatePin_FullMethodName = "/proto.AuthService/ValidatePin"
|
||||
AuthService_ValidateCaptcha_FullMethodName = "/proto.AuthService/ValidateCaptcha"
|
||||
)
|
||||
|
||||
// AuthServiceClient is the client API for AuthService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuthServiceClient interface {
|
||||
Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error)
|
||||
ValidatePin(ctx context.Context, in *ValidatePinRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
|
||||
ValidateCaptcha(ctx context.Context, in *ValidateCaptchaRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthenticateResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_Authenticate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ValidatePin(ctx context.Context, in *ValidatePinRequest, opts ...grpc.CallOption) (*ValidateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ValidateResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ValidatePin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ValidateCaptcha(ctx context.Context, in *ValidateCaptchaRequest, opts ...grpc.CallOption) (*ValidateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ValidateResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ValidateCaptcha_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility.
|
||||
type AuthServiceServer interface {
|
||||
Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error)
|
||||
ValidatePin(context.Context, *ValidatePinRequest) (*ValidateResponse, error)
|
||||
ValidateCaptcha(context.Context, *ValidateCaptchaRequest) (*ValidateResponse, error)
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAuthServiceServer struct{}
|
||||
|
||||
func (UnimplementedAuthServiceServer) Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Authenticate not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ValidatePin(context.Context, *ValidatePinRequest) (*ValidateResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ValidatePin not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ValidateCaptcha(context.Context, *ValidateCaptchaRequest) (*ValidateResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ValidateCaptcha not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthServiceServer interface {
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAuthServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AuthService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AuthenticateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).Authenticate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_Authenticate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).Authenticate(ctx, req.(*AuthenticateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ValidatePin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ValidatePinRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ValidatePin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ValidatePin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ValidatePin(ctx, req.(*ValidatePinRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ValidateCaptcha_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ValidateCaptchaRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ValidateCaptcha(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ValidateCaptcha_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ValidateCaptcha(ctx, req.(*ValidateCaptchaRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.AuthService",
|
||||
HandlerType: (*AuthServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Authenticate",
|
||||
Handler: _AuthService_Authenticate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ValidatePin",
|
||||
Handler: _AuthService_ValidatePin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ValidateCaptcha",
|
||||
Handler: _AuthService_ValidateCaptcha_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "auth.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
PermissionService_HasPermission_FullMethodName = "/proto.PermissionService/HasPermission"
|
||||
PermissionService_GetPermission_FullMethodName = "/proto.PermissionService/GetPermission"
|
||||
PermissionService_AddPermissionNode_FullMethodName = "/proto.PermissionService/AddPermissionNode"
|
||||
PermissionService_AddPermissionNodeToGroup_FullMethodName = "/proto.PermissionService/AddPermissionNodeToGroup"
|
||||
PermissionService_RemovePermissionNode_FullMethodName = "/proto.PermissionService/RemovePermissionNode"
|
||||
PermissionService_RemovePermissionNodeFromGroup_FullMethodName = "/proto.PermissionService/RemovePermissionNodeFromGroup"
|
||||
)
|
||||
|
||||
// PermissionServiceClient is the client API for PermissionService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PermissionServiceClient interface {
|
||||
HasPermission(ctx context.Context, in *HasPermissionRequest, opts ...grpc.CallOption) (*HasPermissionResponse, error)
|
||||
GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*GetPermissionResponse, error)
|
||||
AddPermissionNode(ctx context.Context, in *AddPermissionNodeRequest, opts ...grpc.CallOption) (*AddPermissionNodeResponse, error)
|
||||
AddPermissionNodeToGroup(ctx context.Context, in *AddPermissionNodeToGroupRequest, opts ...grpc.CallOption) (*AddPermissionNodeToGroupResponse, error)
|
||||
RemovePermissionNode(ctx context.Context, in *RemovePermissionNodeRequest, opts ...grpc.CallOption) (*RemovePermissionNodeResponse, error)
|
||||
RemovePermissionNodeFromGroup(ctx context.Context, in *RemovePermissionNodeFromGroupRequest, opts ...grpc.CallOption) (*RemovePermissionNodeFromGroupResponse, error)
|
||||
}
|
||||
|
||||
type permissionServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient {
|
||||
return &permissionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) HasPermission(ctx context.Context, in *HasPermissionRequest, opts ...grpc.CallOption) (*HasPermissionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HasPermissionResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_HasPermission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*GetPermissionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPermissionResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_GetPermission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) AddPermissionNode(ctx context.Context, in *AddPermissionNodeRequest, opts ...grpc.CallOption) (*AddPermissionNodeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddPermissionNodeResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_AddPermissionNode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) AddPermissionNodeToGroup(ctx context.Context, in *AddPermissionNodeToGroupRequest, opts ...grpc.CallOption) (*AddPermissionNodeToGroupResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddPermissionNodeToGroupResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_AddPermissionNodeToGroup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) RemovePermissionNode(ctx context.Context, in *RemovePermissionNodeRequest, opts ...grpc.CallOption) (*RemovePermissionNodeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemovePermissionNodeResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_RemovePermissionNode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionServiceClient) RemovePermissionNodeFromGroup(ctx context.Context, in *RemovePermissionNodeFromGroupRequest, opts ...grpc.CallOption) (*RemovePermissionNodeFromGroupResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemovePermissionNodeFromGroupResponse)
|
||||
err := c.cc.Invoke(ctx, PermissionService_RemovePermissionNodeFromGroup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PermissionServiceServer is the server API for PermissionService service.
|
||||
// All implementations must embed UnimplementedPermissionServiceServer
|
||||
// for forward compatibility.
|
||||
type PermissionServiceServer interface {
|
||||
HasPermission(context.Context, *HasPermissionRequest) (*HasPermissionResponse, error)
|
||||
GetPermission(context.Context, *GetPermissionRequest) (*GetPermissionResponse, error)
|
||||
AddPermissionNode(context.Context, *AddPermissionNodeRequest) (*AddPermissionNodeResponse, error)
|
||||
AddPermissionNodeToGroup(context.Context, *AddPermissionNodeToGroupRequest) (*AddPermissionNodeToGroupResponse, error)
|
||||
RemovePermissionNode(context.Context, *RemovePermissionNodeRequest) (*RemovePermissionNodeResponse, error)
|
||||
RemovePermissionNodeFromGroup(context.Context, *RemovePermissionNodeFromGroupRequest) (*RemovePermissionNodeFromGroupResponse, error)
|
||||
mustEmbedUnimplementedPermissionServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPermissionServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPermissionServiceServer struct{}
|
||||
|
||||
func (UnimplementedPermissionServiceServer) HasPermission(context.Context, *HasPermissionRequest) (*HasPermissionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HasPermission not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) GetPermission(context.Context, *GetPermissionRequest) (*GetPermissionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPermission not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) AddPermissionNode(context.Context, *AddPermissionNodeRequest) (*AddPermissionNodeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddPermissionNode not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) AddPermissionNodeToGroup(context.Context, *AddPermissionNodeToGroupRequest) (*AddPermissionNodeToGroupResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddPermissionNodeToGroup not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) RemovePermissionNode(context.Context, *RemovePermissionNodeRequest) (*RemovePermissionNodeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemovePermissionNode not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) RemovePermissionNodeFromGroup(context.Context, *RemovePermissionNodeFromGroupRequest) (*RemovePermissionNodeFromGroupResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemovePermissionNodeFromGroup not implemented")
|
||||
}
|
||||
func (UnimplementedPermissionServiceServer) mustEmbedUnimplementedPermissionServiceServer() {}
|
||||
func (UnimplementedPermissionServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePermissionServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PermissionServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePermissionServiceServer interface {
|
||||
mustEmbedUnimplementedPermissionServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedPermissionServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PermissionService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PermissionService_HasPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HasPermissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).HasPermission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_HasPermission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).HasPermission(ctx, req.(*HasPermissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PermissionService_GetPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPermissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).GetPermission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_GetPermission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).GetPermission(ctx, req.(*GetPermissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PermissionService_AddPermissionNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddPermissionNodeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).AddPermissionNode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_AddPermissionNode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).AddPermissionNode(ctx, req.(*AddPermissionNodeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PermissionService_AddPermissionNodeToGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddPermissionNodeToGroupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).AddPermissionNodeToGroup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_AddPermissionNodeToGroup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).AddPermissionNodeToGroup(ctx, req.(*AddPermissionNodeToGroupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PermissionService_RemovePermissionNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RemovePermissionNodeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).RemovePermissionNode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_RemovePermissionNode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).RemovePermissionNode(ctx, req.(*RemovePermissionNodeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PermissionService_RemovePermissionNodeFromGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RemovePermissionNodeFromGroupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PermissionServiceServer).RemovePermissionNodeFromGroup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PermissionService_RemovePermissionNodeFromGroup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PermissionServiceServer).RemovePermissionNodeFromGroup(ctx, req.(*RemovePermissionNodeFromGroupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PermissionService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.PermissionService",
|
||||
HandlerType: (*PermissionServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "HasPermission",
|
||||
Handler: _PermissionService_HasPermission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPermission",
|
||||
Handler: _PermissionService_GetPermission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddPermissionNode",
|
||||
Handler: _PermissionService_AddPermissionNode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddPermissionNodeToGroup",
|
||||
Handler: _PermissionService_AddPermissionNodeToGroup_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemovePermissionNode",
|
||||
Handler: _PermissionService_RemovePermissionNode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemovePermissionNodeFromGroup",
|
||||
Handler: _PermissionService_RemovePermissionNodeFromGroup_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "auth.proto",
|
||||
}
|
||||
1694
pkg/shared/proto/gen/develop.pb.go
Normal file
1694
pkg/shared/proto/gen/develop.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
570
pkg/shared/proto/gen/develop_grpc.pb.go
Normal file
570
pkg/shared/proto/gen/develop_grpc.pb.go
Normal file
@@ -0,0 +1,570 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: develop.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
CustomAppService_GetCustomApp_FullMethodName = "/proto.CustomAppService/GetCustomApp"
|
||||
CustomAppService_CheckCustomAppSecret_FullMethodName = "/proto.CustomAppService/CheckCustomAppSecret"
|
||||
)
|
||||
|
||||
// CustomAppServiceClient is the client API for CustomAppService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type CustomAppServiceClient interface {
|
||||
GetCustomApp(ctx context.Context, in *GetCustomAppRequest, opts ...grpc.CallOption) (*GetCustomAppResponse, error)
|
||||
CheckCustomAppSecret(ctx context.Context, in *CheckCustomAppSecretRequest, opts ...grpc.CallOption) (*CheckCustomAppSecretResponse, error)
|
||||
}
|
||||
|
||||
type customAppServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCustomAppServiceClient(cc grpc.ClientConnInterface) CustomAppServiceClient {
|
||||
return &customAppServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *customAppServiceClient) GetCustomApp(ctx context.Context, in *GetCustomAppRequest, opts ...grpc.CallOption) (*GetCustomAppResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCustomAppResponse)
|
||||
err := c.cc.Invoke(ctx, CustomAppService_GetCustomApp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *customAppServiceClient) CheckCustomAppSecret(ctx context.Context, in *CheckCustomAppSecretRequest, opts ...grpc.CallOption) (*CheckCustomAppSecretResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CheckCustomAppSecretResponse)
|
||||
err := c.cc.Invoke(ctx, CustomAppService_CheckCustomAppSecret_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// CustomAppServiceServer is the server API for CustomAppService service.
|
||||
// All implementations must embed UnimplementedCustomAppServiceServer
|
||||
// for forward compatibility.
|
||||
type CustomAppServiceServer interface {
|
||||
GetCustomApp(context.Context, *GetCustomAppRequest) (*GetCustomAppResponse, error)
|
||||
CheckCustomAppSecret(context.Context, *CheckCustomAppSecretRequest) (*CheckCustomAppSecretResponse, error)
|
||||
mustEmbedUnimplementedCustomAppServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedCustomAppServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCustomAppServiceServer struct{}
|
||||
|
||||
func (UnimplementedCustomAppServiceServer) GetCustomApp(context.Context, *GetCustomAppRequest) (*GetCustomAppResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetCustomApp not implemented")
|
||||
}
|
||||
func (UnimplementedCustomAppServiceServer) CheckCustomAppSecret(context.Context, *CheckCustomAppSecretRequest) (*CheckCustomAppSecretResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CheckCustomAppSecret not implemented")
|
||||
}
|
||||
func (UnimplementedCustomAppServiceServer) mustEmbedUnimplementedCustomAppServiceServer() {}
|
||||
func (UnimplementedCustomAppServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCustomAppServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CustomAppServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCustomAppServiceServer interface {
|
||||
mustEmbedUnimplementedCustomAppServiceServer()
|
||||
}
|
||||
|
||||
func RegisterCustomAppServiceServer(s grpc.ServiceRegistrar, srv CustomAppServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedCustomAppServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&CustomAppService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _CustomAppService_GetCustomApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCustomAppRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CustomAppServiceServer).GetCustomApp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CustomAppService_GetCustomApp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CustomAppServiceServer).GetCustomApp(ctx, req.(*GetCustomAppRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CustomAppService_CheckCustomAppSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckCustomAppSecretRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CustomAppServiceServer).CheckCustomAppSecret(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CustomAppService_CheckCustomAppSecret_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CustomAppServiceServer).CheckCustomAppSecret(ctx, req.(*CheckCustomAppSecretRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// CustomAppService_ServiceDesc is the grpc.ServiceDesc for CustomAppService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var CustomAppService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.CustomAppService",
|
||||
HandlerType: (*CustomAppServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetCustomApp",
|
||||
Handler: _CustomAppService_GetCustomApp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckCustomAppSecret",
|
||||
Handler: _CustomAppService_CheckCustomAppSecret_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "develop.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
BotAccountReceiverService_CreateBotAccount_FullMethodName = "/proto.BotAccountReceiverService/CreateBotAccount"
|
||||
BotAccountReceiverService_UpdateBotAccount_FullMethodName = "/proto.BotAccountReceiverService/UpdateBotAccount"
|
||||
BotAccountReceiverService_DeleteBotAccount_FullMethodName = "/proto.BotAccountReceiverService/DeleteBotAccount"
|
||||
BotAccountReceiverService_GetApiKey_FullMethodName = "/proto.BotAccountReceiverService/GetApiKey"
|
||||
BotAccountReceiverService_ListApiKey_FullMethodName = "/proto.BotAccountReceiverService/ListApiKey"
|
||||
BotAccountReceiverService_CreateApiKey_FullMethodName = "/proto.BotAccountReceiverService/CreateApiKey"
|
||||
BotAccountReceiverService_UpdateApiKey_FullMethodName = "/proto.BotAccountReceiverService/UpdateApiKey"
|
||||
BotAccountReceiverService_RotateApiKey_FullMethodName = "/proto.BotAccountReceiverService/RotateApiKey"
|
||||
BotAccountReceiverService_DeleteApiKey_FullMethodName = "/proto.BotAccountReceiverService/DeleteApiKey"
|
||||
)
|
||||
|
||||
// BotAccountReceiverServiceClient is the client API for BotAccountReceiverService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// This service should be implemented by the Pass service to handle the creation, update, and deletion of bot accounts
|
||||
type BotAccountReceiverServiceClient interface {
|
||||
CreateBotAccount(ctx context.Context, in *CreateBotAccountRequest, opts ...grpc.CallOption) (*CreateBotAccountResponse, error)
|
||||
UpdateBotAccount(ctx context.Context, in *UpdateBotAccountRequest, opts ...grpc.CallOption) (*UpdateBotAccountResponse, error)
|
||||
DeleteBotAccount(ctx context.Context, in *DeleteBotAccountRequest, opts ...grpc.CallOption) (*DeleteBotAccountResponse, error)
|
||||
GetApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*ApiKey, error)
|
||||
ListApiKey(ctx context.Context, in *ListApiKeyRequest, opts ...grpc.CallOption) (*GetApiKeyBatchResponse, error)
|
||||
CreateApiKey(ctx context.Context, in *ApiKey, opts ...grpc.CallOption) (*ApiKey, error)
|
||||
UpdateApiKey(ctx context.Context, in *ApiKey, opts ...grpc.CallOption) (*ApiKey, error)
|
||||
RotateApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*ApiKey, error)
|
||||
DeleteApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*DeleteApiKeyResponse, error)
|
||||
}
|
||||
|
||||
type botAccountReceiverServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewBotAccountReceiverServiceClient(cc grpc.ClientConnInterface) BotAccountReceiverServiceClient {
|
||||
return &botAccountReceiverServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) CreateBotAccount(ctx context.Context, in *CreateBotAccountRequest, opts ...grpc.CallOption) (*CreateBotAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateBotAccountResponse)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_CreateBotAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) UpdateBotAccount(ctx context.Context, in *UpdateBotAccountRequest, opts ...grpc.CallOption) (*UpdateBotAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateBotAccountResponse)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_UpdateBotAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) DeleteBotAccount(ctx context.Context, in *DeleteBotAccountRequest, opts ...grpc.CallOption) (*DeleteBotAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteBotAccountResponse)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_DeleteBotAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) GetApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*ApiKey, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApiKey)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_GetApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) ListApiKey(ctx context.Context, in *ListApiKeyRequest, opts ...grpc.CallOption) (*GetApiKeyBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetApiKeyBatchResponse)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_ListApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) CreateApiKey(ctx context.Context, in *ApiKey, opts ...grpc.CallOption) (*ApiKey, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApiKey)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_CreateApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) UpdateApiKey(ctx context.Context, in *ApiKey, opts ...grpc.CallOption) (*ApiKey, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApiKey)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_UpdateApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) RotateApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*ApiKey, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApiKey)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_RotateApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *botAccountReceiverServiceClient) DeleteApiKey(ctx context.Context, in *GetApiKeyRequest, opts ...grpc.CallOption) (*DeleteApiKeyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteApiKeyResponse)
|
||||
err := c.cc.Invoke(ctx, BotAccountReceiverService_DeleteApiKey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// BotAccountReceiverServiceServer is the server API for BotAccountReceiverService service.
|
||||
// All implementations must embed UnimplementedBotAccountReceiverServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// This service should be implemented by the Pass service to handle the creation, update, and deletion of bot accounts
|
||||
type BotAccountReceiverServiceServer interface {
|
||||
CreateBotAccount(context.Context, *CreateBotAccountRequest) (*CreateBotAccountResponse, error)
|
||||
UpdateBotAccount(context.Context, *UpdateBotAccountRequest) (*UpdateBotAccountResponse, error)
|
||||
DeleteBotAccount(context.Context, *DeleteBotAccountRequest) (*DeleteBotAccountResponse, error)
|
||||
GetApiKey(context.Context, *GetApiKeyRequest) (*ApiKey, error)
|
||||
ListApiKey(context.Context, *ListApiKeyRequest) (*GetApiKeyBatchResponse, error)
|
||||
CreateApiKey(context.Context, *ApiKey) (*ApiKey, error)
|
||||
UpdateApiKey(context.Context, *ApiKey) (*ApiKey, error)
|
||||
RotateApiKey(context.Context, *GetApiKeyRequest) (*ApiKey, error)
|
||||
DeleteApiKey(context.Context, *GetApiKeyRequest) (*DeleteApiKeyResponse, error)
|
||||
mustEmbedUnimplementedBotAccountReceiverServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedBotAccountReceiverServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedBotAccountReceiverServiceServer struct{}
|
||||
|
||||
func (UnimplementedBotAccountReceiverServiceServer) CreateBotAccount(context.Context, *CreateBotAccountRequest) (*CreateBotAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateBotAccount not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) UpdateBotAccount(context.Context, *UpdateBotAccountRequest) (*UpdateBotAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateBotAccount not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) DeleteBotAccount(context.Context, *DeleteBotAccountRequest) (*DeleteBotAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteBotAccount not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) GetApiKey(context.Context, *GetApiKeyRequest) (*ApiKey, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) ListApiKey(context.Context, *ListApiKeyRequest) (*GetApiKeyBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) CreateApiKey(context.Context, *ApiKey) (*ApiKey, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) UpdateApiKey(context.Context, *ApiKey) (*ApiKey, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) RotateApiKey(context.Context, *GetApiKeyRequest) (*ApiKey, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RotateApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) DeleteApiKey(context.Context, *GetApiKeyRequest) (*DeleteApiKeyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteApiKey not implemented")
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) mustEmbedUnimplementedBotAccountReceiverServiceServer() {
|
||||
}
|
||||
func (UnimplementedBotAccountReceiverServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeBotAccountReceiverServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to BotAccountReceiverServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeBotAccountReceiverServiceServer interface {
|
||||
mustEmbedUnimplementedBotAccountReceiverServiceServer()
|
||||
}
|
||||
|
||||
func RegisterBotAccountReceiverServiceServer(s grpc.ServiceRegistrar, srv BotAccountReceiverServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedBotAccountReceiverServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&BotAccountReceiverService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_CreateBotAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateBotAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).CreateBotAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_CreateBotAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).CreateBotAccount(ctx, req.(*CreateBotAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_UpdateBotAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateBotAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).UpdateBotAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_UpdateBotAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).UpdateBotAccount(ctx, req.(*UpdateBotAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_DeleteBotAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteBotAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).DeleteBotAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_DeleteBotAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).DeleteBotAccount(ctx, req.(*DeleteBotAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_GetApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetApiKeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).GetApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_GetApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).GetApiKey(ctx, req.(*GetApiKeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_ListApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListApiKeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).ListApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_ListApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).ListApiKey(ctx, req.(*ListApiKeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_CreateApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApiKey)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).CreateApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_CreateApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).CreateApiKey(ctx, req.(*ApiKey))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_UpdateApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApiKey)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).UpdateApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_UpdateApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).UpdateApiKey(ctx, req.(*ApiKey))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_RotateApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetApiKeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).RotateApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_RotateApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).RotateApiKey(ctx, req.(*GetApiKeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BotAccountReceiverService_DeleteApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetApiKeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BotAccountReceiverServiceServer).DeleteApiKey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BotAccountReceiverService_DeleteApiKey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BotAccountReceiverServiceServer).DeleteApiKey(ctx, req.(*GetApiKeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// BotAccountReceiverService_ServiceDesc is the grpc.ServiceDesc for BotAccountReceiverService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var BotAccountReceiverService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.BotAccountReceiverService",
|
||||
HandlerType: (*BotAccountReceiverServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateBotAccount",
|
||||
Handler: _BotAccountReceiverService_CreateBotAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateBotAccount",
|
||||
Handler: _BotAccountReceiverService_UpdateBotAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteBotAccount",
|
||||
Handler: _BotAccountReceiverService_DeleteBotAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetApiKey",
|
||||
Handler: _BotAccountReceiverService_GetApiKey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListApiKey",
|
||||
Handler: _BotAccountReceiverService_ListApiKey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateApiKey",
|
||||
Handler: _BotAccountReceiverService_CreateApiKey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateApiKey",
|
||||
Handler: _BotAccountReceiverService_UpdateApiKey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RotateApiKey",
|
||||
Handler: _BotAccountReceiverService_RotateApiKey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteApiKey",
|
||||
Handler: _BotAccountReceiverService_DeleteApiKey_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "develop.proto",
|
||||
}
|
||||
2357
pkg/shared/proto/gen/file.pb.go
Normal file
2357
pkg/shared/proto/gen/file.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
952
pkg/shared/proto/gen/file_grpc.pb.go
Normal file
952
pkg/shared/proto/gen/file_grpc.pb.go
Normal file
@@ -0,0 +1,952 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: file.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
FileService_GetFile_FullMethodName = "/proto.FileService/GetFile"
|
||||
FileService_GetFileBatch_FullMethodName = "/proto.FileService/GetFileBatch"
|
||||
FileService_UpdateFile_FullMethodName = "/proto.FileService/UpdateFile"
|
||||
FileService_DeleteFile_FullMethodName = "/proto.FileService/DeleteFile"
|
||||
FileService_LoadFromReference_FullMethodName = "/proto.FileService/LoadFromReference"
|
||||
FileService_IsReferenced_FullMethodName = "/proto.FileService/IsReferenced"
|
||||
FileService_PurgeCache_FullMethodName = "/proto.FileService/PurgeCache"
|
||||
)
|
||||
|
||||
// FileServiceClient is the client API for FileService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Service for file operations
|
||||
type FileServiceClient interface {
|
||||
// Get file reference by ID
|
||||
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*CloudFile, error)
|
||||
GetFileBatch(ctx context.Context, in *GetFileBatchRequest, opts ...grpc.CallOption) (*GetFileBatchResponse, error)
|
||||
// Update an existing file reference
|
||||
UpdateFile(ctx context.Context, in *UpdateFileRequest, opts ...grpc.CallOption) (*CloudFile, error)
|
||||
// Delete a file reference
|
||||
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Load files from references
|
||||
LoadFromReference(ctx context.Context, in *LoadFromReferenceRequest, opts ...grpc.CallOption) (*LoadFromReferenceResponse, error)
|
||||
// Check if a file is referenced by any resource
|
||||
IsReferenced(ctx context.Context, in *IsReferencedRequest, opts ...grpc.CallOption) (*IsReferencedResponse, error)
|
||||
// Purge cache for a file
|
||||
PurgeCache(ctx context.Context, in *PurgeCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type fileServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
|
||||
return &fileServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*CloudFile, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudFile)
|
||||
err := c.cc.Invoke(ctx, FileService_GetFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) GetFileBatch(ctx context.Context, in *GetFileBatchRequest, opts ...grpc.CallOption) (*GetFileBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetFileBatchResponse)
|
||||
err := c.cc.Invoke(ctx, FileService_GetFileBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) UpdateFile(ctx context.Context, in *UpdateFileRequest, opts ...grpc.CallOption) (*CloudFile, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudFile)
|
||||
err := c.cc.Invoke(ctx, FileService_UpdateFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, FileService_DeleteFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) LoadFromReference(ctx context.Context, in *LoadFromReferenceRequest, opts ...grpc.CallOption) (*LoadFromReferenceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoadFromReferenceResponse)
|
||||
err := c.cc.Invoke(ctx, FileService_LoadFromReference_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) IsReferenced(ctx context.Context, in *IsReferencedRequest, opts ...grpc.CallOption) (*IsReferencedResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(IsReferencedResponse)
|
||||
err := c.cc.Invoke(ctx, FileService_IsReferenced_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileServiceClient) PurgeCache(ctx context.Context, in *PurgeCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, FileService_PurgeCache_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// FileServiceServer is the server API for FileService service.
|
||||
// All implementations must embed UnimplementedFileServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Service for file operations
|
||||
type FileServiceServer interface {
|
||||
// Get file reference by ID
|
||||
GetFile(context.Context, *GetFileRequest) (*CloudFile, error)
|
||||
GetFileBatch(context.Context, *GetFileBatchRequest) (*GetFileBatchResponse, error)
|
||||
// Update an existing file reference
|
||||
UpdateFile(context.Context, *UpdateFileRequest) (*CloudFile, error)
|
||||
// Delete a file reference
|
||||
DeleteFile(context.Context, *DeleteFileRequest) (*emptypb.Empty, error)
|
||||
// Load files from references
|
||||
LoadFromReference(context.Context, *LoadFromReferenceRequest) (*LoadFromReferenceResponse, error)
|
||||
// Check if a file is referenced by any resource
|
||||
IsReferenced(context.Context, *IsReferencedRequest) (*IsReferencedResponse, error)
|
||||
// Purge cache for a file
|
||||
PurgeCache(context.Context, *PurgeCacheRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedFileServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedFileServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedFileServiceServer struct{}
|
||||
|
||||
func (UnimplementedFileServiceServer) GetFile(context.Context, *GetFileRequest) (*CloudFile, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetFile not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) GetFileBatch(context.Context, *GetFileBatchRequest) (*GetFileBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetFileBatch not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) UpdateFile(context.Context, *UpdateFileRequest) (*CloudFile, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateFile not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteFile not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) LoadFromReference(context.Context, *LoadFromReferenceRequest) (*LoadFromReferenceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoadFromReference not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) IsReferenced(context.Context, *IsReferencedRequest) (*IsReferencedResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IsReferenced not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) PurgeCache(context.Context, *PurgeCacheRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PurgeCache not implemented")
|
||||
}
|
||||
func (UnimplementedFileServiceServer) mustEmbedUnimplementedFileServiceServer() {}
|
||||
func (UnimplementedFileServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeFileServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FileServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeFileServiceServer interface {
|
||||
mustEmbedUnimplementedFileServiceServer()
|
||||
}
|
||||
|
||||
func RegisterFileServiceServer(s grpc.ServiceRegistrar, srv FileServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedFileServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&FileService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _FileService_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetFileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).GetFile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_GetFile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).GetFile(ctx, req.(*GetFileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_GetFileBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetFileBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).GetFileBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_GetFileBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).GetFileBatch(ctx, req.(*GetFileBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_UpdateFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateFileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).UpdateFile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_UpdateFile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).UpdateFile(ctx, req.(*UpdateFileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteFileRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).DeleteFile(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_DeleteFile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_LoadFromReference_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoadFromReferenceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).LoadFromReference(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_LoadFromReference_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).LoadFromReference(ctx, req.(*LoadFromReferenceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_IsReferenced_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IsReferencedRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).IsReferenced(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_IsReferenced_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).IsReferenced(ctx, req.(*IsReferencedRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileService_PurgeCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PurgeCacheRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileServiceServer).PurgeCache(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileService_PurgeCache_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileServiceServer).PurgeCache(ctx, req.(*PurgeCacheRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// FileService_ServiceDesc is the grpc.ServiceDesc for FileService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var FileService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.FileService",
|
||||
HandlerType: (*FileServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetFile",
|
||||
Handler: _FileService_GetFile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetFileBatch",
|
||||
Handler: _FileService_GetFileBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateFile",
|
||||
Handler: _FileService_UpdateFile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteFile",
|
||||
Handler: _FileService_DeleteFile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoadFromReference",
|
||||
Handler: _FileService_LoadFromReference_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsReferenced",
|
||||
Handler: _FileService_IsReferenced_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PurgeCache",
|
||||
Handler: _FileService_PurgeCache_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "file.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
FileReferenceService_CreateReference_FullMethodName = "/proto.FileReferenceService/CreateReference"
|
||||
FileReferenceService_CreateReferenceBatch_FullMethodName = "/proto.FileReferenceService/CreateReferenceBatch"
|
||||
FileReferenceService_GetReferences_FullMethodName = "/proto.FileReferenceService/GetReferences"
|
||||
FileReferenceService_GetReferenceCount_FullMethodName = "/proto.FileReferenceService/GetReferenceCount"
|
||||
FileReferenceService_GetResourceReferences_FullMethodName = "/proto.FileReferenceService/GetResourceReferences"
|
||||
FileReferenceService_GetResourceFiles_FullMethodName = "/proto.FileReferenceService/GetResourceFiles"
|
||||
FileReferenceService_DeleteResourceReferences_FullMethodName = "/proto.FileReferenceService/DeleteResourceReferences"
|
||||
FileReferenceService_DeleteResourceReferencesBatch_FullMethodName = "/proto.FileReferenceService/DeleteResourceReferencesBatch"
|
||||
FileReferenceService_DeleteReference_FullMethodName = "/proto.FileReferenceService/DeleteReference"
|
||||
FileReferenceService_UpdateResourceFiles_FullMethodName = "/proto.FileReferenceService/UpdateResourceFiles"
|
||||
FileReferenceService_SetReferenceExpiration_FullMethodName = "/proto.FileReferenceService/SetReferenceExpiration"
|
||||
FileReferenceService_SetFileReferencesExpiration_FullMethodName = "/proto.FileReferenceService/SetFileReferencesExpiration"
|
||||
FileReferenceService_HasFileReferences_FullMethodName = "/proto.FileReferenceService/HasFileReferences"
|
||||
)
|
||||
|
||||
// FileReferenceServiceClient is the client API for FileReferenceService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Service for managing file references
|
||||
type FileReferenceServiceClient interface {
|
||||
// Creates a new reference to a file for a specific resource
|
||||
CreateReference(ctx context.Context, in *CreateReferenceRequest, opts ...grpc.CallOption) (*CloudFileReference, error)
|
||||
CreateReferenceBatch(ctx context.Context, in *CreateReferenceBatchRequest, opts ...grpc.CallOption) (*CreateReferenceBatchResponse, error)
|
||||
// Gets all references to a file
|
||||
GetReferences(ctx context.Context, in *GetReferencesRequest, opts ...grpc.CallOption) (*GetReferencesResponse, error)
|
||||
// Gets the number of references to a file
|
||||
GetReferenceCount(ctx context.Context, in *GetReferenceCountRequest, opts ...grpc.CallOption) (*GetReferenceCountResponse, error)
|
||||
// Gets all references for a specific resource and optional usage
|
||||
GetResourceReferences(ctx context.Context, in *GetResourceReferencesRequest, opts ...grpc.CallOption) (*GetReferencesResponse, error)
|
||||
// Gets all files referenced by a resource with optional usage filter
|
||||
GetResourceFiles(ctx context.Context, in *GetResourceFilesRequest, opts ...grpc.CallOption) (*GetResourceFilesResponse, error)
|
||||
// Deletes references for a specific resource and optional usage
|
||||
DeleteResourceReferences(ctx context.Context, in *DeleteResourceReferencesRequest, opts ...grpc.CallOption) (*DeleteResourceReferencesResponse, error)
|
||||
// Deletes references for multiple specific resources and optional usage
|
||||
DeleteResourceReferencesBatch(ctx context.Context, in *DeleteResourceReferencesBatchRequest, opts ...grpc.CallOption) (*DeleteResourceReferencesResponse, error)
|
||||
// Deletes a specific file reference
|
||||
DeleteReference(ctx context.Context, in *DeleteReferenceRequest, opts ...grpc.CallOption) (*DeleteReferenceResponse, error)
|
||||
// Updates the files referenced by a resource
|
||||
UpdateResourceFiles(ctx context.Context, in *UpdateResourceFilesRequest, opts ...grpc.CallOption) (*UpdateResourceFilesResponse, error)
|
||||
// Updates the expiration time for a file reference
|
||||
SetReferenceExpiration(ctx context.Context, in *SetReferenceExpirationRequest, opts ...grpc.CallOption) (*SetReferenceExpirationResponse, error)
|
||||
// Updates the expiration time for all references to a file
|
||||
SetFileReferencesExpiration(ctx context.Context, in *SetFileReferencesExpirationRequest, opts ...grpc.CallOption) (*SetFileReferencesExpirationResponse, error)
|
||||
// Checks if a file has any references
|
||||
HasFileReferences(ctx context.Context, in *HasFileReferencesRequest, opts ...grpc.CallOption) (*HasFileReferencesResponse, error)
|
||||
}
|
||||
|
||||
type fileReferenceServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewFileReferenceServiceClient(cc grpc.ClientConnInterface) FileReferenceServiceClient {
|
||||
return &fileReferenceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) CreateReference(ctx context.Context, in *CreateReferenceRequest, opts ...grpc.CallOption) (*CloudFileReference, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudFileReference)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_CreateReference_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) CreateReferenceBatch(ctx context.Context, in *CreateReferenceBatchRequest, opts ...grpc.CallOption) (*CreateReferenceBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateReferenceBatchResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_CreateReferenceBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) GetReferences(ctx context.Context, in *GetReferencesRequest, opts ...grpc.CallOption) (*GetReferencesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetReferencesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_GetReferences_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) GetReferenceCount(ctx context.Context, in *GetReferenceCountRequest, opts ...grpc.CallOption) (*GetReferenceCountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetReferenceCountResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_GetReferenceCount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) GetResourceReferences(ctx context.Context, in *GetResourceReferencesRequest, opts ...grpc.CallOption) (*GetReferencesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetReferencesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_GetResourceReferences_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) GetResourceFiles(ctx context.Context, in *GetResourceFilesRequest, opts ...grpc.CallOption) (*GetResourceFilesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetResourceFilesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_GetResourceFiles_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) DeleteResourceReferences(ctx context.Context, in *DeleteResourceReferencesRequest, opts ...grpc.CallOption) (*DeleteResourceReferencesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteResourceReferencesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_DeleteResourceReferences_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) DeleteResourceReferencesBatch(ctx context.Context, in *DeleteResourceReferencesBatchRequest, opts ...grpc.CallOption) (*DeleteResourceReferencesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteResourceReferencesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_DeleteResourceReferencesBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) DeleteReference(ctx context.Context, in *DeleteReferenceRequest, opts ...grpc.CallOption) (*DeleteReferenceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteReferenceResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_DeleteReference_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) UpdateResourceFiles(ctx context.Context, in *UpdateResourceFilesRequest, opts ...grpc.CallOption) (*UpdateResourceFilesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateResourceFilesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_UpdateResourceFiles_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) SetReferenceExpiration(ctx context.Context, in *SetReferenceExpirationRequest, opts ...grpc.CallOption) (*SetReferenceExpirationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetReferenceExpirationResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_SetReferenceExpiration_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) SetFileReferencesExpiration(ctx context.Context, in *SetFileReferencesExpirationRequest, opts ...grpc.CallOption) (*SetFileReferencesExpirationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetFileReferencesExpirationResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_SetFileReferencesExpiration_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *fileReferenceServiceClient) HasFileReferences(ctx context.Context, in *HasFileReferencesRequest, opts ...grpc.CallOption) (*HasFileReferencesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HasFileReferencesResponse)
|
||||
err := c.cc.Invoke(ctx, FileReferenceService_HasFileReferences_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// FileReferenceServiceServer is the server API for FileReferenceService service.
|
||||
// All implementations must embed UnimplementedFileReferenceServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Service for managing file references
|
||||
type FileReferenceServiceServer interface {
|
||||
// Creates a new reference to a file for a specific resource
|
||||
CreateReference(context.Context, *CreateReferenceRequest) (*CloudFileReference, error)
|
||||
CreateReferenceBatch(context.Context, *CreateReferenceBatchRequest) (*CreateReferenceBatchResponse, error)
|
||||
// Gets all references to a file
|
||||
GetReferences(context.Context, *GetReferencesRequest) (*GetReferencesResponse, error)
|
||||
// Gets the number of references to a file
|
||||
GetReferenceCount(context.Context, *GetReferenceCountRequest) (*GetReferenceCountResponse, error)
|
||||
// Gets all references for a specific resource and optional usage
|
||||
GetResourceReferences(context.Context, *GetResourceReferencesRequest) (*GetReferencesResponse, error)
|
||||
// Gets all files referenced by a resource with optional usage filter
|
||||
GetResourceFiles(context.Context, *GetResourceFilesRequest) (*GetResourceFilesResponse, error)
|
||||
// Deletes references for a specific resource and optional usage
|
||||
DeleteResourceReferences(context.Context, *DeleteResourceReferencesRequest) (*DeleteResourceReferencesResponse, error)
|
||||
// Deletes references for multiple specific resources and optional usage
|
||||
DeleteResourceReferencesBatch(context.Context, *DeleteResourceReferencesBatchRequest) (*DeleteResourceReferencesResponse, error)
|
||||
// Deletes a specific file reference
|
||||
DeleteReference(context.Context, *DeleteReferenceRequest) (*DeleteReferenceResponse, error)
|
||||
// Updates the files referenced by a resource
|
||||
UpdateResourceFiles(context.Context, *UpdateResourceFilesRequest) (*UpdateResourceFilesResponse, error)
|
||||
// Updates the expiration time for a file reference
|
||||
SetReferenceExpiration(context.Context, *SetReferenceExpirationRequest) (*SetReferenceExpirationResponse, error)
|
||||
// Updates the expiration time for all references to a file
|
||||
SetFileReferencesExpiration(context.Context, *SetFileReferencesExpirationRequest) (*SetFileReferencesExpirationResponse, error)
|
||||
// Checks if a file has any references
|
||||
HasFileReferences(context.Context, *HasFileReferencesRequest) (*HasFileReferencesResponse, error)
|
||||
mustEmbedUnimplementedFileReferenceServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedFileReferenceServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedFileReferenceServiceServer struct{}
|
||||
|
||||
func (UnimplementedFileReferenceServiceServer) CreateReference(context.Context, *CreateReferenceRequest) (*CloudFileReference, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateReference not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) CreateReferenceBatch(context.Context, *CreateReferenceBatchRequest) (*CreateReferenceBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateReferenceBatch not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) GetReferences(context.Context, *GetReferencesRequest) (*GetReferencesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetReferences not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) GetReferenceCount(context.Context, *GetReferenceCountRequest) (*GetReferenceCountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetReferenceCount not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) GetResourceReferences(context.Context, *GetResourceReferencesRequest) (*GetReferencesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetResourceReferences not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) GetResourceFiles(context.Context, *GetResourceFilesRequest) (*GetResourceFilesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetResourceFiles not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) DeleteResourceReferences(context.Context, *DeleteResourceReferencesRequest) (*DeleteResourceReferencesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteResourceReferences not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) DeleteResourceReferencesBatch(context.Context, *DeleteResourceReferencesBatchRequest) (*DeleteResourceReferencesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteResourceReferencesBatch not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) DeleteReference(context.Context, *DeleteReferenceRequest) (*DeleteReferenceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteReference not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) UpdateResourceFiles(context.Context, *UpdateResourceFilesRequest) (*UpdateResourceFilesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateResourceFiles not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) SetReferenceExpiration(context.Context, *SetReferenceExpirationRequest) (*SetReferenceExpirationResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetReferenceExpiration not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) SetFileReferencesExpiration(context.Context, *SetFileReferencesExpirationRequest) (*SetFileReferencesExpirationResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetFileReferencesExpiration not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) HasFileReferences(context.Context, *HasFileReferencesRequest) (*HasFileReferencesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HasFileReferences not implemented")
|
||||
}
|
||||
func (UnimplementedFileReferenceServiceServer) mustEmbedUnimplementedFileReferenceServiceServer() {}
|
||||
func (UnimplementedFileReferenceServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeFileReferenceServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FileReferenceServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeFileReferenceServiceServer interface {
|
||||
mustEmbedUnimplementedFileReferenceServiceServer()
|
||||
}
|
||||
|
||||
func RegisterFileReferenceServiceServer(s grpc.ServiceRegistrar, srv FileReferenceServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedFileReferenceServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&FileReferenceService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _FileReferenceService_CreateReference_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateReferenceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).CreateReference(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_CreateReference_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).CreateReference(ctx, req.(*CreateReferenceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_CreateReferenceBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateReferenceBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).CreateReferenceBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_CreateReferenceBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).CreateReferenceBatch(ctx, req.(*CreateReferenceBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_GetReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetReferencesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).GetReferences(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_GetReferences_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).GetReferences(ctx, req.(*GetReferencesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_GetReferenceCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetReferenceCountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).GetReferenceCount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_GetReferenceCount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).GetReferenceCount(ctx, req.(*GetReferenceCountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_GetResourceReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetResourceReferencesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).GetResourceReferences(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_GetResourceReferences_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).GetResourceReferences(ctx, req.(*GetResourceReferencesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_GetResourceFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetResourceFilesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).GetResourceFiles(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_GetResourceFiles_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).GetResourceFiles(ctx, req.(*GetResourceFilesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_DeleteResourceReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteResourceReferencesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).DeleteResourceReferences(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_DeleteResourceReferences_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).DeleteResourceReferences(ctx, req.(*DeleteResourceReferencesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_DeleteResourceReferencesBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteResourceReferencesBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).DeleteResourceReferencesBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_DeleteResourceReferencesBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).DeleteResourceReferencesBatch(ctx, req.(*DeleteResourceReferencesBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_DeleteReference_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteReferenceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).DeleteReference(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_DeleteReference_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).DeleteReference(ctx, req.(*DeleteReferenceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_UpdateResourceFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateResourceFilesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).UpdateResourceFiles(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_UpdateResourceFiles_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).UpdateResourceFiles(ctx, req.(*UpdateResourceFilesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_SetReferenceExpiration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetReferenceExpirationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).SetReferenceExpiration(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_SetReferenceExpiration_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).SetReferenceExpiration(ctx, req.(*SetReferenceExpirationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_SetFileReferencesExpiration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetFileReferencesExpirationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).SetFileReferencesExpiration(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_SetFileReferencesExpiration_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).SetFileReferencesExpiration(ctx, req.(*SetFileReferencesExpirationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _FileReferenceService_HasFileReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HasFileReferencesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(FileReferenceServiceServer).HasFileReferences(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: FileReferenceService_HasFileReferences_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(FileReferenceServiceServer).HasFileReferences(ctx, req.(*HasFileReferencesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// FileReferenceService_ServiceDesc is the grpc.ServiceDesc for FileReferenceService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var FileReferenceService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.FileReferenceService",
|
||||
HandlerType: (*FileReferenceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateReference",
|
||||
Handler: _FileReferenceService_CreateReference_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateReferenceBatch",
|
||||
Handler: _FileReferenceService_CreateReferenceBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetReferences",
|
||||
Handler: _FileReferenceService_GetReferences_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetReferenceCount",
|
||||
Handler: _FileReferenceService_GetReferenceCount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetResourceReferences",
|
||||
Handler: _FileReferenceService_GetResourceReferences_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetResourceFiles",
|
||||
Handler: _FileReferenceService_GetResourceFiles_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteResourceReferences",
|
||||
Handler: _FileReferenceService_DeleteResourceReferences_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteResourceReferencesBatch",
|
||||
Handler: _FileReferenceService_DeleteResourceReferencesBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteReference",
|
||||
Handler: _FileReferenceService_DeleteReference_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateResourceFiles",
|
||||
Handler: _FileReferenceService_UpdateResourceFiles_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetReferenceExpiration",
|
||||
Handler: _FileReferenceService_SetReferenceExpiration_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetFileReferencesExpiration",
|
||||
Handler: _FileReferenceService_SetFileReferencesExpiration_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HasFileReferences",
|
||||
Handler: _FileReferenceService_HasFileReferences_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "file.proto",
|
||||
}
|
||||
573
pkg/shared/proto/gen/leveling.pb.go
Normal file
573
pkg/shared/proto/gen/leveling.pb.go
Normal file
@@ -0,0 +1,573 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.33.1
|
||||
// source: leveling.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// SocialCreditRecord represents a record of social credit changes for an account
|
||||
type SocialCreditRecord struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // UUID string
|
||||
ReasonType string `protobuf:"bytes,2,opt,name=reason_type,json=reasonType,proto3" json:"reason_type,omitempty"`
|
||||
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
Delta float64 `protobuf:"fixed64,4,opt,name=delta,proto3" json:"delta,omitempty"`
|
||||
AccountId string `protobuf:"bytes,5,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // UUID string
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) Reset() {
|
||||
*x = SocialCreditRecord{}
|
||||
mi := &file_leveling_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SocialCreditRecord) ProtoMessage() {}
|
||||
|
||||
func (x *SocialCreditRecord) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SocialCreditRecord.ProtoReflect.Descriptor instead.
|
||||
func (*SocialCreditRecord) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetReasonType() string {
|
||||
if x != nil {
|
||||
return x.ReasonType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetDelta() float64 {
|
||||
if x != nil {
|
||||
return x.Delta
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetAccountId() string {
|
||||
if x != nil {
|
||||
return x.AccountId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SocialCreditRecord) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExperienceRecord represents a record of experience points gained by an account
|
||||
type ExperienceRecord struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // UUID string
|
||||
ReasonType string `protobuf:"bytes,2,opt,name=reason_type,json=reasonType,proto3" json:"reason_type,omitempty"`
|
||||
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
Delta int64 `protobuf:"varint,4,opt,name=delta,proto3" json:"delta,omitempty"`
|
||||
BonusMultiplier float64 `protobuf:"fixed64,5,opt,name=bonus_multiplier,json=bonusMultiplier,proto3" json:"bonus_multiplier,omitempty"`
|
||||
AccountId string `protobuf:"bytes,6,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // UUID string
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) Reset() {
|
||||
*x = ExperienceRecord{}
|
||||
mi := &file_leveling_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExperienceRecord) ProtoMessage() {}
|
||||
|
||||
func (x *ExperienceRecord) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExperienceRecord.ProtoReflect.Descriptor instead.
|
||||
func (*ExperienceRecord) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetReasonType() string {
|
||||
if x != nil {
|
||||
return x.ReasonType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetDelta() int64 {
|
||||
if x != nil {
|
||||
return x.Delta
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetBonusMultiplier() float64 {
|
||||
if x != nil {
|
||||
return x.BonusMultiplier
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetAccountId() string {
|
||||
if x != nil {
|
||||
return x.AccountId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExperienceRecord) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Social Credit Requests/Responses
|
||||
type AddSocialCreditRecordRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ReasonType string `protobuf:"bytes,1,opt,name=reason_type,json=reasonType,proto3" json:"reason_type,omitempty"`
|
||||
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
Delta float64 `protobuf:"fixed64,3,opt,name=delta,proto3" json:"delta,omitempty"`
|
||||
AccountId string `protobuf:"bytes,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // UUID string
|
||||
ExpiredAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) Reset() {
|
||||
*x = AddSocialCreditRecordRequest{}
|
||||
mi := &file_leveling_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AddSocialCreditRecordRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AddSocialCreditRecordRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AddSocialCreditRecordRequest) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) GetReasonType() string {
|
||||
if x != nil {
|
||||
return x.ReasonType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) GetDelta() float64 {
|
||||
if x != nil {
|
||||
return x.Delta
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) GetAccountId() string {
|
||||
if x != nil {
|
||||
return x.AccountId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddSocialCreditRecordRequest) GetExpiredAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.ExpiredAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetSocialCreditRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // UUID string
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSocialCreditRequest) Reset() {
|
||||
*x = GetSocialCreditRequest{}
|
||||
mi := &file_leveling_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSocialCreditRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSocialCreditRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSocialCreditRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSocialCreditRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSocialCreditRequest) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetSocialCreditRequest) GetAccountId() string {
|
||||
if x != nil {
|
||||
return x.AccountId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SocialCreditResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Amount float64 `protobuf:"fixed64,1,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SocialCreditResponse) Reset() {
|
||||
*x = SocialCreditResponse{}
|
||||
mi := &file_leveling_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SocialCreditResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SocialCreditResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SocialCreditResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SocialCreditResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SocialCreditResponse) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *SocialCreditResponse) GetAmount() float64 {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Experience Requests/Responses
|
||||
type AddExperienceRecordRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ReasonType string `protobuf:"bytes,1,opt,name=reason_type,json=reasonType,proto3" json:"reason_type,omitempty"`
|
||||
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
Delta int64 `protobuf:"varint,3,opt,name=delta,proto3" json:"delta,omitempty"`
|
||||
AccountId string `protobuf:"bytes,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // UUID string
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) Reset() {
|
||||
*x = AddExperienceRecordRequest{}
|
||||
mi := &file_leveling_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AddExperienceRecordRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AddExperienceRecordRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_leveling_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AddExperienceRecordRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AddExperienceRecordRequest) Descriptor() ([]byte, []int) {
|
||||
return file_leveling_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) GetReasonType() string {
|
||||
if x != nil {
|
||||
return x.ReasonType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) GetDelta() int64 {
|
||||
if x != nil {
|
||||
return x.Delta
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AddExperienceRecordRequest) GetAccountId() string {
|
||||
if x != nil {
|
||||
return x.AccountId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_leveling_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_leveling_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x0eleveling.proto\x12\x05proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x88\x02\n" +
|
||||
"\x12SocialCreditRecord\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" +
|
||||
"\vreason_type\x18\x02 \x01(\tR\n" +
|
||||
"reasonType\x12\x16\n" +
|
||||
"\x06reason\x18\x03 \x01(\tR\x06reason\x12\x14\n" +
|
||||
"\x05delta\x18\x04 \x01(\x01R\x05delta\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\x05 \x01(\tR\taccountId\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xb1\x02\n" +
|
||||
"\x10ExperienceRecord\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" +
|
||||
"\vreason_type\x18\x02 \x01(\tR\n" +
|
||||
"reasonType\x12\x16\n" +
|
||||
"\x06reason\x18\x03 \x01(\tR\x06reason\x12\x14\n" +
|
||||
"\x05delta\x18\x04 \x01(\x03R\x05delta\x12)\n" +
|
||||
"\x10bonus_multiplier\x18\x05 \x01(\x01R\x0fbonusMultiplier\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\x06 \x01(\tR\taccountId\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xc7\x01\n" +
|
||||
"\x1cAddSocialCreditRecordRequest\x12\x1f\n" +
|
||||
"\vreason_type\x18\x01 \x01(\tR\n" +
|
||||
"reasonType\x12\x16\n" +
|
||||
"\x06reason\x18\x02 \x01(\tR\x06reason\x12\x14\n" +
|
||||
"\x05delta\x18\x03 \x01(\x01R\x05delta\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\x04 \x01(\tR\taccountId\x129\n" +
|
||||
"\n" +
|
||||
"expired_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\texpiredAt\"7\n" +
|
||||
"\x16GetSocialCreditRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\x01 \x01(\tR\taccountId\".\n" +
|
||||
"\x14SocialCreditResponse\x12\x16\n" +
|
||||
"\x06amount\x18\x01 \x01(\x01R\x06amount\"\x8a\x01\n" +
|
||||
"\x1aAddExperienceRecordRequest\x12\x1f\n" +
|
||||
"\vreason_type\x18\x01 \x01(\tR\n" +
|
||||
"reasonType\x12\x16\n" +
|
||||
"\x06reason\x18\x02 \x01(\tR\x06reason\x12\x14\n" +
|
||||
"\x05delta\x18\x03 \x01(\x03R\x05delta\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\x04 \x01(\tR\taccountId2\xb1\x01\n" +
|
||||
"\x13SocialCreditService\x12K\n" +
|
||||
"\tAddRecord\x12#.proto.AddSocialCreditRecordRequest\x1a\x19.proto.SocialCreditRecord\x12M\n" +
|
||||
"\x0fGetSocialCredit\x12\x1d.proto.GetSocialCreditRequest\x1a\x1b.proto.SocialCreditResponse2\\\n" +
|
||||
"\x11ExperienceService\x12G\n" +
|
||||
"\tAddRecord\x12!.proto.AddExperienceRecordRequest\x1a\x17.proto.ExperienceRecordBUZ7git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen\xaa\x02\x19DysonNetwork.Shared.Protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_leveling_proto_rawDescOnce sync.Once
|
||||
file_leveling_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_leveling_proto_rawDescGZIP() []byte {
|
||||
file_leveling_proto_rawDescOnce.Do(func() {
|
||||
file_leveling_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_leveling_proto_rawDesc), len(file_leveling_proto_rawDesc)))
|
||||
})
|
||||
return file_leveling_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_leveling_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_leveling_proto_goTypes = []any{
|
||||
(*SocialCreditRecord)(nil), // 0: proto.SocialCreditRecord
|
||||
(*ExperienceRecord)(nil), // 1: proto.ExperienceRecord
|
||||
(*AddSocialCreditRecordRequest)(nil), // 2: proto.AddSocialCreditRecordRequest
|
||||
(*GetSocialCreditRequest)(nil), // 3: proto.GetSocialCreditRequest
|
||||
(*SocialCreditResponse)(nil), // 4: proto.SocialCreditResponse
|
||||
(*AddExperienceRecordRequest)(nil), // 5: proto.AddExperienceRecordRequest
|
||||
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
|
||||
}
|
||||
var file_leveling_proto_depIdxs = []int32{
|
||||
6, // 0: proto.SocialCreditRecord.created_at:type_name -> google.protobuf.Timestamp
|
||||
6, // 1: proto.SocialCreditRecord.updated_at:type_name -> google.protobuf.Timestamp
|
||||
6, // 2: proto.ExperienceRecord.created_at:type_name -> google.protobuf.Timestamp
|
||||
6, // 3: proto.ExperienceRecord.updated_at:type_name -> google.protobuf.Timestamp
|
||||
6, // 4: proto.AddSocialCreditRecordRequest.expired_at:type_name -> google.protobuf.Timestamp
|
||||
2, // 5: proto.SocialCreditService.AddRecord:input_type -> proto.AddSocialCreditRecordRequest
|
||||
3, // 6: proto.SocialCreditService.GetSocialCredit:input_type -> proto.GetSocialCreditRequest
|
||||
5, // 7: proto.ExperienceService.AddRecord:input_type -> proto.AddExperienceRecordRequest
|
||||
0, // 8: proto.SocialCreditService.AddRecord:output_type -> proto.SocialCreditRecord
|
||||
4, // 9: proto.SocialCreditService.GetSocialCredit:output_type -> proto.SocialCreditResponse
|
||||
1, // 10: proto.ExperienceService.AddRecord:output_type -> proto.ExperienceRecord
|
||||
8, // [8:11] is the sub-list for method output_type
|
||||
5, // [5:8] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_leveling_proto_init() }
|
||||
func file_leveling_proto_init() {
|
||||
if File_leveling_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_leveling_proto_rawDesc), len(file_leveling_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 2,
|
||||
},
|
||||
GoTypes: file_leveling_proto_goTypes,
|
||||
DependencyIndexes: file_leveling_proto_depIdxs,
|
||||
MessageInfos: file_leveling_proto_msgTypes,
|
||||
}.Build()
|
||||
File_leveling_proto = out.File
|
||||
file_leveling_proto_goTypes = nil
|
||||
file_leveling_proto_depIdxs = nil
|
||||
}
|
||||
275
pkg/shared/proto/gen/leveling_grpc.pb.go
Normal file
275
pkg/shared/proto/gen/leveling_grpc.pb.go
Normal file
@@ -0,0 +1,275 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: leveling.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SocialCreditService_AddRecord_FullMethodName = "/proto.SocialCreditService/AddRecord"
|
||||
SocialCreditService_GetSocialCredit_FullMethodName = "/proto.SocialCreditService/GetSocialCredit"
|
||||
)
|
||||
|
||||
// SocialCreditServiceClient is the client API for SocialCreditService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// SocialCreditService provides operations for managing social credit scores
|
||||
type SocialCreditServiceClient interface {
|
||||
// Adds a new social credit record for an account
|
||||
AddRecord(ctx context.Context, in *AddSocialCreditRecordRequest, opts ...grpc.CallOption) (*SocialCreditRecord, error)
|
||||
// Gets the current social credit score for an account
|
||||
GetSocialCredit(ctx context.Context, in *GetSocialCreditRequest, opts ...grpc.CallOption) (*SocialCreditResponse, error)
|
||||
}
|
||||
|
||||
type socialCreditServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSocialCreditServiceClient(cc grpc.ClientConnInterface) SocialCreditServiceClient {
|
||||
return &socialCreditServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *socialCreditServiceClient) AddRecord(ctx context.Context, in *AddSocialCreditRecordRequest, opts ...grpc.CallOption) (*SocialCreditRecord, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SocialCreditRecord)
|
||||
err := c.cc.Invoke(ctx, SocialCreditService_AddRecord_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *socialCreditServiceClient) GetSocialCredit(ctx context.Context, in *GetSocialCreditRequest, opts ...grpc.CallOption) (*SocialCreditResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SocialCreditResponse)
|
||||
err := c.cc.Invoke(ctx, SocialCreditService_GetSocialCredit_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SocialCreditServiceServer is the server API for SocialCreditService service.
|
||||
// All implementations must embed UnimplementedSocialCreditServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// SocialCreditService provides operations for managing social credit scores
|
||||
type SocialCreditServiceServer interface {
|
||||
// Adds a new social credit record for an account
|
||||
AddRecord(context.Context, *AddSocialCreditRecordRequest) (*SocialCreditRecord, error)
|
||||
// Gets the current social credit score for an account
|
||||
GetSocialCredit(context.Context, *GetSocialCreditRequest) (*SocialCreditResponse, error)
|
||||
mustEmbedUnimplementedSocialCreditServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedSocialCreditServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSocialCreditServiceServer struct{}
|
||||
|
||||
func (UnimplementedSocialCreditServiceServer) AddRecord(context.Context, *AddSocialCreditRecordRequest) (*SocialCreditRecord, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddRecord not implemented")
|
||||
}
|
||||
func (UnimplementedSocialCreditServiceServer) GetSocialCredit(context.Context, *GetSocialCreditRequest) (*SocialCreditResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSocialCredit not implemented")
|
||||
}
|
||||
func (UnimplementedSocialCreditServiceServer) mustEmbedUnimplementedSocialCreditServiceServer() {}
|
||||
func (UnimplementedSocialCreditServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSocialCreditServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SocialCreditServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSocialCreditServiceServer interface {
|
||||
mustEmbedUnimplementedSocialCreditServiceServer()
|
||||
}
|
||||
|
||||
func RegisterSocialCreditServiceServer(s grpc.ServiceRegistrar, srv SocialCreditServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedSocialCreditServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&SocialCreditService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SocialCreditService_AddRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddSocialCreditRecordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SocialCreditServiceServer).AddRecord(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SocialCreditService_AddRecord_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SocialCreditServiceServer).AddRecord(ctx, req.(*AddSocialCreditRecordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SocialCreditService_GetSocialCredit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSocialCreditRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SocialCreditServiceServer).GetSocialCredit(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SocialCreditService_GetSocialCredit_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SocialCreditServiceServer).GetSocialCredit(ctx, req.(*GetSocialCreditRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SocialCreditService_ServiceDesc is the grpc.ServiceDesc for SocialCreditService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SocialCreditService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.SocialCreditService",
|
||||
HandlerType: (*SocialCreditServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AddRecord",
|
||||
Handler: _SocialCreditService_AddRecord_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSocialCredit",
|
||||
Handler: _SocialCreditService_GetSocialCredit_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "leveling.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
ExperienceService_AddRecord_FullMethodName = "/proto.ExperienceService/AddRecord"
|
||||
)
|
||||
|
||||
// ExperienceServiceClient is the client API for ExperienceService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// ExperienceService provides operations for managing experience points
|
||||
type ExperienceServiceClient interface {
|
||||
// Adds a new experience record for an account
|
||||
AddRecord(ctx context.Context, in *AddExperienceRecordRequest, opts ...grpc.CallOption) (*ExperienceRecord, error)
|
||||
}
|
||||
|
||||
type experienceServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewExperienceServiceClient(cc grpc.ClientConnInterface) ExperienceServiceClient {
|
||||
return &experienceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *experienceServiceClient) AddRecord(ctx context.Context, in *AddExperienceRecordRequest, opts ...grpc.CallOption) (*ExperienceRecord, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExperienceRecord)
|
||||
err := c.cc.Invoke(ctx, ExperienceService_AddRecord_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ExperienceServiceServer is the server API for ExperienceService service.
|
||||
// All implementations must embed UnimplementedExperienceServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// ExperienceService provides operations for managing experience points
|
||||
type ExperienceServiceServer interface {
|
||||
// Adds a new experience record for an account
|
||||
AddRecord(context.Context, *AddExperienceRecordRequest) (*ExperienceRecord, error)
|
||||
mustEmbedUnimplementedExperienceServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedExperienceServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedExperienceServiceServer struct{}
|
||||
|
||||
func (UnimplementedExperienceServiceServer) AddRecord(context.Context, *AddExperienceRecordRequest) (*ExperienceRecord, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddRecord not implemented")
|
||||
}
|
||||
func (UnimplementedExperienceServiceServer) mustEmbedUnimplementedExperienceServiceServer() {}
|
||||
func (UnimplementedExperienceServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeExperienceServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ExperienceServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeExperienceServiceServer interface {
|
||||
mustEmbedUnimplementedExperienceServiceServer()
|
||||
}
|
||||
|
||||
func RegisterExperienceServiceServer(s grpc.ServiceRegistrar, srv ExperienceServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedExperienceServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ExperienceService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ExperienceService_AddRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddExperienceRecordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExperienceServiceServer).AddRecord(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExperienceService_AddRecord_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExperienceServiceServer).AddRecord(ctx, req.(*AddExperienceRecordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ExperienceService_ServiceDesc is the grpc.ServiceDesc for ExperienceService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ExperienceService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.ExperienceService",
|
||||
HandlerType: (*ExperienceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AddRecord",
|
||||
Handler: _ExperienceService_AddRecord_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "leveling.proto",
|
||||
}
|
||||
2409
pkg/shared/proto/gen/post.pb.go
Normal file
2409
pkg/shared/proto/gen/post.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
243
pkg/shared/proto/gen/post_grpc.pb.go
Normal file
243
pkg/shared/proto/gen/post_grpc.pb.go
Normal file
@@ -0,0 +1,243 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: post.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PostService_GetPost_FullMethodName = "/proto.PostService/GetPost"
|
||||
PostService_GetPostBatch_FullMethodName = "/proto.PostService/GetPostBatch"
|
||||
PostService_SearchPosts_FullMethodName = "/proto.PostService/SearchPosts"
|
||||
PostService_ListPosts_FullMethodName = "/proto.PostService/ListPosts"
|
||||
)
|
||||
|
||||
// PostServiceClient is the client API for PostService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PostServiceClient interface {
|
||||
// Get a single post by id
|
||||
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*Post, error)
|
||||
// Get multiple posts by ids
|
||||
GetPostBatch(ctx context.Context, in *GetPostBatchRequest, opts ...grpc.CallOption) (*GetPostBatchResponse, error)
|
||||
// Search posts
|
||||
SearchPosts(ctx context.Context, in *SearchPostsRequest, opts ...grpc.CallOption) (*SearchPostsResponse, error)
|
||||
// List posts with filters
|
||||
ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error)
|
||||
}
|
||||
|
||||
type postServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient {
|
||||
return &postServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *postServiceClient) GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*Post, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Post)
|
||||
err := c.cc.Invoke(ctx, PostService_GetPost_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) GetPostBatch(ctx context.Context, in *GetPostBatchRequest, opts ...grpc.CallOption) (*GetPostBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPostBatchResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_GetPostBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) SearchPosts(ctx context.Context, in *SearchPostsRequest, opts ...grpc.CallOption) (*SearchPostsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SearchPostsResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_SearchPosts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postServiceClient) ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPostsResponse)
|
||||
err := c.cc.Invoke(ctx, PostService_ListPosts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PostServiceServer is the server API for PostService service.
|
||||
// All implementations must embed UnimplementedPostServiceServer
|
||||
// for forward compatibility.
|
||||
type PostServiceServer interface {
|
||||
// Get a single post by id
|
||||
GetPost(context.Context, *GetPostRequest) (*Post, error)
|
||||
// Get multiple posts by ids
|
||||
GetPostBatch(context.Context, *GetPostBatchRequest) (*GetPostBatchResponse, error)
|
||||
// Search posts
|
||||
SearchPosts(context.Context, *SearchPostsRequest) (*SearchPostsResponse, error)
|
||||
// List posts with filters
|
||||
ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error)
|
||||
mustEmbedUnimplementedPostServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPostServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPostServiceServer struct{}
|
||||
|
||||
func (UnimplementedPostServiceServer) GetPost(context.Context, *GetPostRequest) (*Post, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPost not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) GetPostBatch(context.Context, *GetPostBatchRequest) (*GetPostBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPostBatch not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) SearchPosts(context.Context, *SearchPostsRequest) (*SearchPostsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchPosts not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPosts not implemented")
|
||||
}
|
||||
func (UnimplementedPostServiceServer) mustEmbedUnimplementedPostServiceServer() {}
|
||||
func (UnimplementedPostServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePostServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PostServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePostServiceServer interface {
|
||||
mustEmbedUnimplementedPostServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedPostServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PostService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PostService_GetPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).GetPost(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_GetPost_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).GetPost(ctx, req.(*GetPostRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_GetPostBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPostBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).GetPostBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_GetPostBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).GetPostBatch(ctx, req.(*GetPostBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_SearchPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchPostsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).SearchPosts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_SearchPosts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).SearchPosts(ctx, req.(*SearchPostsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PostService_ListPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPostsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PostServiceServer).ListPosts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PostService_ListPosts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServiceServer).ListPosts(ctx, req.(*ListPostsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PostService_ServiceDesc is the grpc.ServiceDesc for PostService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PostService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.PostService",
|
||||
HandlerType: (*PostServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetPost",
|
||||
Handler: _PostService_GetPost_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPostBatch",
|
||||
Handler: _PostService_GetPostBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SearchPosts",
|
||||
Handler: _PostService_SearchPosts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPosts",
|
||||
Handler: _PostService_ListPosts_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "post.proto",
|
||||
}
|
||||
1246
pkg/shared/proto/gen/publisher.pb.go
Normal file
1246
pkg/shared/proto/gen/publisher.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
350
pkg/shared/proto/gen/publisher_grpc.pb.go
Normal file
350
pkg/shared/proto/gen/publisher_grpc.pb.go
Normal file
@@ -0,0 +1,350 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: publisher.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PublisherService_GetPublisher_FullMethodName = "/proto.PublisherService/GetPublisher"
|
||||
PublisherService_GetPublisherBatch_FullMethodName = "/proto.PublisherService/GetPublisherBatch"
|
||||
PublisherService_ListPublishers_FullMethodName = "/proto.PublisherService/ListPublishers"
|
||||
PublisherService_ListPublisherMembers_FullMethodName = "/proto.PublisherService/ListPublisherMembers"
|
||||
PublisherService_SetPublisherFeatureFlag_FullMethodName = "/proto.PublisherService/SetPublisherFeatureFlag"
|
||||
PublisherService_HasPublisherFeature_FullMethodName = "/proto.PublisherService/HasPublisherFeature"
|
||||
PublisherService_IsPublisherMember_FullMethodName = "/proto.PublisherService/IsPublisherMember"
|
||||
)
|
||||
|
||||
// PublisherServiceClient is the client API for PublisherService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PublisherServiceClient interface {
|
||||
GetPublisher(ctx context.Context, in *GetPublisherRequest, opts ...grpc.CallOption) (*GetPublisherResponse, error)
|
||||
GetPublisherBatch(ctx context.Context, in *GetPublisherBatchRequest, opts ...grpc.CallOption) (*ListPublishersResponse, error)
|
||||
ListPublishers(ctx context.Context, in *ListPublishersRequest, opts ...grpc.CallOption) (*ListPublishersResponse, error)
|
||||
ListPublisherMembers(ctx context.Context, in *ListPublisherMembersRequest, opts ...grpc.CallOption) (*ListPublisherMembersResponse, error)
|
||||
SetPublisherFeatureFlag(ctx context.Context, in *SetPublisherFeatureFlagRequest, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
|
||||
HasPublisherFeature(ctx context.Context, in *HasPublisherFeatureRequest, opts ...grpc.CallOption) (*HasPublisherFeatureResponse, error)
|
||||
IsPublisherMember(ctx context.Context, in *IsPublisherMemberRequest, opts ...grpc.CallOption) (*IsPublisherMemberResponse, error)
|
||||
}
|
||||
|
||||
type publisherServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPublisherServiceClient(cc grpc.ClientConnInterface) PublisherServiceClient {
|
||||
return &publisherServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) GetPublisher(ctx context.Context, in *GetPublisherRequest, opts ...grpc.CallOption) (*GetPublisherResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPublisherResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_GetPublisher_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) GetPublisherBatch(ctx context.Context, in *GetPublisherBatchRequest, opts ...grpc.CallOption) (*ListPublishersResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPublishersResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_GetPublisherBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) ListPublishers(ctx context.Context, in *ListPublishersRequest, opts ...grpc.CallOption) (*ListPublishersResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPublishersResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_ListPublishers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) ListPublisherMembers(ctx context.Context, in *ListPublisherMembersRequest, opts ...grpc.CallOption) (*ListPublisherMembersResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPublisherMembersResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_ListPublisherMembers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) SetPublisherFeatureFlag(ctx context.Context, in *SetPublisherFeatureFlagRequest, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(wrapperspb.StringValue)
|
||||
err := c.cc.Invoke(ctx, PublisherService_SetPublisherFeatureFlag_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) HasPublisherFeature(ctx context.Context, in *HasPublisherFeatureRequest, opts ...grpc.CallOption) (*HasPublisherFeatureResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HasPublisherFeatureResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_HasPublisherFeature_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publisherServiceClient) IsPublisherMember(ctx context.Context, in *IsPublisherMemberRequest, opts ...grpc.CallOption) (*IsPublisherMemberResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(IsPublisherMemberResponse)
|
||||
err := c.cc.Invoke(ctx, PublisherService_IsPublisherMember_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PublisherServiceServer is the server API for PublisherService service.
|
||||
// All implementations must embed UnimplementedPublisherServiceServer
|
||||
// for forward compatibility.
|
||||
type PublisherServiceServer interface {
|
||||
GetPublisher(context.Context, *GetPublisherRequest) (*GetPublisherResponse, error)
|
||||
GetPublisherBatch(context.Context, *GetPublisherBatchRequest) (*ListPublishersResponse, error)
|
||||
ListPublishers(context.Context, *ListPublishersRequest) (*ListPublishersResponse, error)
|
||||
ListPublisherMembers(context.Context, *ListPublisherMembersRequest) (*ListPublisherMembersResponse, error)
|
||||
SetPublisherFeatureFlag(context.Context, *SetPublisherFeatureFlagRequest) (*wrapperspb.StringValue, error)
|
||||
HasPublisherFeature(context.Context, *HasPublisherFeatureRequest) (*HasPublisherFeatureResponse, error)
|
||||
IsPublisherMember(context.Context, *IsPublisherMemberRequest) (*IsPublisherMemberResponse, error)
|
||||
mustEmbedUnimplementedPublisherServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPublisherServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPublisherServiceServer struct{}
|
||||
|
||||
func (UnimplementedPublisherServiceServer) GetPublisher(context.Context, *GetPublisherRequest) (*GetPublisherResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPublisher not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) GetPublisherBatch(context.Context, *GetPublisherBatchRequest) (*ListPublishersResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPublisherBatch not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) ListPublishers(context.Context, *ListPublishersRequest) (*ListPublishersResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPublishers not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) ListPublisherMembers(context.Context, *ListPublisherMembersRequest) (*ListPublisherMembersResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPublisherMembers not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) SetPublisherFeatureFlag(context.Context, *SetPublisherFeatureFlagRequest) (*wrapperspb.StringValue, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPublisherFeatureFlag not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) HasPublisherFeature(context.Context, *HasPublisherFeatureRequest) (*HasPublisherFeatureResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HasPublisherFeature not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) IsPublisherMember(context.Context, *IsPublisherMemberRequest) (*IsPublisherMemberResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IsPublisherMember not implemented")
|
||||
}
|
||||
func (UnimplementedPublisherServiceServer) mustEmbedUnimplementedPublisherServiceServer() {}
|
||||
func (UnimplementedPublisherServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePublisherServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PublisherServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePublisherServiceServer interface {
|
||||
mustEmbedUnimplementedPublisherServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPublisherServiceServer(s grpc.ServiceRegistrar, srv PublisherServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedPublisherServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PublisherService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PublisherService_GetPublisher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPublisherRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).GetPublisher(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_GetPublisher_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).GetPublisher(ctx, req.(*GetPublisherRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_GetPublisherBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPublisherBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).GetPublisherBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_GetPublisherBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).GetPublisherBatch(ctx, req.(*GetPublisherBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_ListPublishers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPublishersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).ListPublishers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_ListPublishers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).ListPublishers(ctx, req.(*ListPublishersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_ListPublisherMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPublisherMembersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).ListPublisherMembers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_ListPublisherMembers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).ListPublisherMembers(ctx, req.(*ListPublisherMembersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_SetPublisherFeatureFlag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetPublisherFeatureFlagRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).SetPublisherFeatureFlag(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_SetPublisherFeatureFlag_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).SetPublisherFeatureFlag(ctx, req.(*SetPublisherFeatureFlagRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_HasPublisherFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HasPublisherFeatureRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).HasPublisherFeature(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_HasPublisherFeature_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).HasPublisherFeature(ctx, req.(*HasPublisherFeatureRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublisherService_IsPublisherMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IsPublisherMemberRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublisherServiceServer).IsPublisherMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PublisherService_IsPublisherMember_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublisherServiceServer).IsPublisherMember(ctx, req.(*IsPublisherMemberRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PublisherService_ServiceDesc is the grpc.ServiceDesc for PublisherService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PublisherService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.PublisherService",
|
||||
HandlerType: (*PublisherServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetPublisher",
|
||||
Handler: _PublisherService_GetPublisher_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPublisherBatch",
|
||||
Handler: _PublisherService_GetPublisherBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPublishers",
|
||||
Handler: _PublisherService_ListPublishers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPublisherMembers",
|
||||
Handler: _PublisherService_ListPublisherMembers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetPublisherFeatureFlag",
|
||||
Handler: _PublisherService_SetPublisherFeatureFlag_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HasPublisherFeature",
|
||||
Handler: _PublisherService_HasPublisherFeature_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsPublisherMember",
|
||||
Handler: _PublisherService_IsPublisherMember_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "publisher.proto",
|
||||
}
|
||||
1060
pkg/shared/proto/gen/realm.pb.go
Normal file
1060
pkg/shared/proto/gen/realm.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
445
pkg/shared/proto/gen/realm_grpc.pb.go
Normal file
445
pkg/shared/proto/gen/realm_grpc.pb.go
Normal file
@@ -0,0 +1,445 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: realm.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RealmService_GetRealm_FullMethodName = "/proto.RealmService/GetRealm"
|
||||
RealmService_GetRealmBatch_FullMethodName = "/proto.RealmService/GetRealmBatch"
|
||||
RealmService_GetUserRealms_FullMethodName = "/proto.RealmService/GetUserRealms"
|
||||
RealmService_GetPublicRealms_FullMethodName = "/proto.RealmService/GetPublicRealms"
|
||||
RealmService_SearchRealms_FullMethodName = "/proto.RealmService/SearchRealms"
|
||||
RealmService_SendInviteNotify_FullMethodName = "/proto.RealmService/SendInviteNotify"
|
||||
RealmService_IsMemberWithRole_FullMethodName = "/proto.RealmService/IsMemberWithRole"
|
||||
RealmService_LoadMemberAccount_FullMethodName = "/proto.RealmService/LoadMemberAccount"
|
||||
RealmService_LoadMemberAccounts_FullMethodName = "/proto.RealmService/LoadMemberAccounts"
|
||||
)
|
||||
|
||||
// RealmServiceClient is the client API for RealmService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RealmServiceClient interface {
|
||||
// Get realm by id or slug
|
||||
GetRealm(ctx context.Context, in *GetRealmRequest, opts ...grpc.CallOption) (*Realm, error)
|
||||
// Get realm batch by ids
|
||||
GetRealmBatch(ctx context.Context, in *GetRealmBatchRequest, opts ...grpc.CallOption) (*GetRealmBatchResponse, error)
|
||||
// Get realms for a user
|
||||
GetUserRealms(ctx context.Context, in *GetUserRealmsRequest, opts ...grpc.CallOption) (*GetUserRealmsResponse, error)
|
||||
// Get public realms
|
||||
GetPublicRealms(ctx context.Context, in *GetPublicRealmsRequest, opts ...grpc.CallOption) (*GetPublicRealmsResponse, error)
|
||||
// Search public realms
|
||||
SearchRealms(ctx context.Context, in *SearchRealmsRequest, opts ...grpc.CallOption) (*GetPublicRealmsResponse, error)
|
||||
// Send invitation notification
|
||||
SendInviteNotify(ctx context.Context, in *SendInviteNotifyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Check if member has required role
|
||||
IsMemberWithRole(ctx context.Context, in *IsMemberWithRoleRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
|
||||
// Load account for a member
|
||||
LoadMemberAccount(ctx context.Context, in *LoadMemberAccountRequest, opts ...grpc.CallOption) (*RealmMember, error)
|
||||
// Load accounts for members
|
||||
LoadMemberAccounts(ctx context.Context, in *LoadMemberAccountsRequest, opts ...grpc.CallOption) (*LoadMemberAccountsResponse, error)
|
||||
}
|
||||
|
||||
type realmServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRealmServiceClient(cc grpc.ClientConnInterface) RealmServiceClient {
|
||||
return &realmServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetRealm(ctx context.Context, in *GetRealmRequest, opts ...grpc.CallOption) (*Realm, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Realm)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetRealm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetRealmBatch(ctx context.Context, in *GetRealmBatchRequest, opts ...grpc.CallOption) (*GetRealmBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetRealmBatchResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetRealmBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetUserRealms(ctx context.Context, in *GetUserRealmsRequest, opts ...grpc.CallOption) (*GetUserRealmsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserRealmsResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetUserRealms_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetPublicRealms(ctx context.Context, in *GetPublicRealmsRequest, opts ...grpc.CallOption) (*GetPublicRealmsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPublicRealmsResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetPublicRealms_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) SearchRealms(ctx context.Context, in *SearchRealmsRequest, opts ...grpc.CallOption) (*GetPublicRealmsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPublicRealmsResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_SearchRealms_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) SendInviteNotify(ctx context.Context, in *SendInviteNotifyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RealmService_SendInviteNotify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) IsMemberWithRole(ctx context.Context, in *IsMemberWithRoleRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(wrapperspb.BoolValue)
|
||||
err := c.cc.Invoke(ctx, RealmService_IsMemberWithRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) LoadMemberAccount(ctx context.Context, in *LoadMemberAccountRequest, opts ...grpc.CallOption) (*RealmMember, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RealmMember)
|
||||
err := c.cc.Invoke(ctx, RealmService_LoadMemberAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) LoadMemberAccounts(ctx context.Context, in *LoadMemberAccountsRequest, opts ...grpc.CallOption) (*LoadMemberAccountsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoadMemberAccountsResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_LoadMemberAccounts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RealmServiceServer is the server API for RealmService service.
|
||||
// All implementations must embed UnimplementedRealmServiceServer
|
||||
// for forward compatibility.
|
||||
type RealmServiceServer interface {
|
||||
// Get realm by id or slug
|
||||
GetRealm(context.Context, *GetRealmRequest) (*Realm, error)
|
||||
// Get realm batch by ids
|
||||
GetRealmBatch(context.Context, *GetRealmBatchRequest) (*GetRealmBatchResponse, error)
|
||||
// Get realms for a user
|
||||
GetUserRealms(context.Context, *GetUserRealmsRequest) (*GetUserRealmsResponse, error)
|
||||
// Get public realms
|
||||
GetPublicRealms(context.Context, *GetPublicRealmsRequest) (*GetPublicRealmsResponse, error)
|
||||
// Search public realms
|
||||
SearchRealms(context.Context, *SearchRealmsRequest) (*GetPublicRealmsResponse, error)
|
||||
// Send invitation notification
|
||||
SendInviteNotify(context.Context, *SendInviteNotifyRequest) (*emptypb.Empty, error)
|
||||
// Check if member has required role
|
||||
IsMemberWithRole(context.Context, *IsMemberWithRoleRequest) (*wrapperspb.BoolValue, error)
|
||||
// Load account for a member
|
||||
LoadMemberAccount(context.Context, *LoadMemberAccountRequest) (*RealmMember, error)
|
||||
// Load accounts for members
|
||||
LoadMemberAccounts(context.Context, *LoadMemberAccountsRequest) (*LoadMemberAccountsResponse, error)
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRealmServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRealmServiceServer struct{}
|
||||
|
||||
func (UnimplementedRealmServiceServer) GetRealm(context.Context, *GetRealmRequest) (*Realm, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) GetRealmBatch(context.Context, *GetRealmBatchRequest) (*GetRealmBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetRealmBatch not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) GetUserRealms(context.Context, *GetUserRealmsRequest) (*GetUserRealmsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUserRealms not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) GetPublicRealms(context.Context, *GetPublicRealmsRequest) (*GetPublicRealmsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPublicRealms not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) SearchRealms(context.Context, *SearchRealmsRequest) (*GetPublicRealmsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchRealms not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) SendInviteNotify(context.Context, *SendInviteNotifyRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendInviteNotify not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) IsMemberWithRole(context.Context, *IsMemberWithRoleRequest) (*wrapperspb.BoolValue, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IsMemberWithRole not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) LoadMemberAccount(context.Context, *LoadMemberAccountRequest) (*RealmMember, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoadMemberAccount not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) LoadMemberAccounts(context.Context, *LoadMemberAccountsRequest) (*LoadMemberAccountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoadMemberAccounts not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) mustEmbedUnimplementedRealmServiceServer() {}
|
||||
func (UnimplementedRealmServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRealmServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RealmServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRealmServiceServer interface {
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRealmServiceServer(s grpc.ServiceRegistrar, srv RealmServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRealmServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RealmService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RealmService_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRealmRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetRealm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, req.(*GetRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_GetRealmBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRealmBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetRealmBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetRealmBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetRealmBatch(ctx, req.(*GetRealmBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_GetUserRealms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserRealmsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetUserRealms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetUserRealms_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetUserRealms(ctx, req.(*GetUserRealmsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_GetPublicRealms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPublicRealmsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetPublicRealms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetPublicRealms_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetPublicRealms(ctx, req.(*GetPublicRealmsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_SearchRealms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SearchRealmsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).SearchRealms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_SearchRealms_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).SearchRealms(ctx, req.(*SearchRealmsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_SendInviteNotify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendInviteNotifyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).SendInviteNotify(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_SendInviteNotify_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).SendInviteNotify(ctx, req.(*SendInviteNotifyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_IsMemberWithRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IsMemberWithRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).IsMemberWithRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_IsMemberWithRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).IsMemberWithRole(ctx, req.(*IsMemberWithRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_LoadMemberAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoadMemberAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).LoadMemberAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_LoadMemberAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).LoadMemberAccount(ctx, req.(*LoadMemberAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_LoadMemberAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoadMemberAccountsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).LoadMemberAccounts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_LoadMemberAccounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).LoadMemberAccounts(ctx, req.(*LoadMemberAccountsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RealmService_ServiceDesc is the grpc.ServiceDesc for RealmService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RealmService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RealmService",
|
||||
HandlerType: (*RealmServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetRealm",
|
||||
Handler: _RealmService_GetRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRealmBatch",
|
||||
Handler: _RealmService_GetRealmBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserRealms",
|
||||
Handler: _RealmService_GetUserRealms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPublicRealms",
|
||||
Handler: _RealmService_GetPublicRealms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SearchRealms",
|
||||
Handler: _RealmService_SearchRealms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendInviteNotify",
|
||||
Handler: _RealmService_SendInviteNotify_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsMemberWithRole",
|
||||
Handler: _RealmService_IsMemberWithRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoadMemberAccount",
|
||||
Handler: _RealmService_LoadMemberAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoadMemberAccounts",
|
||||
Handler: _RealmService_LoadMemberAccounts_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "realm.proto",
|
||||
}
|
||||
1322
pkg/shared/proto/gen/ring.pb.go
Normal file
1322
pkg/shared/proto/gen/ring.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
588
pkg/shared/proto/gen/ring_grpc.pb.go
Normal file
588
pkg/shared/proto/gen/ring_grpc.pb.go
Normal file
@@ -0,0 +1,588 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: ring.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RingService_SendEmail_FullMethodName = "/proto.RingService/SendEmail"
|
||||
RingService_PushWebSocketPacket_FullMethodName = "/proto.RingService/PushWebSocketPacket"
|
||||
RingService_PushWebSocketPacketToUsers_FullMethodName = "/proto.RingService/PushWebSocketPacketToUsers"
|
||||
RingService_PushWebSocketPacketToDevice_FullMethodName = "/proto.RingService/PushWebSocketPacketToDevice"
|
||||
RingService_PushWebSocketPacketToDevices_FullMethodName = "/proto.RingService/PushWebSocketPacketToDevices"
|
||||
RingService_SendPushNotificationToUser_FullMethodName = "/proto.RingService/SendPushNotificationToUser"
|
||||
RingService_SendPushNotificationToUsers_FullMethodName = "/proto.RingService/SendPushNotificationToUsers"
|
||||
RingService_UnsubscribePushNotifications_FullMethodName = "/proto.RingService/UnsubscribePushNotifications"
|
||||
RingService_GetWebsocketConnectionStatus_FullMethodName = "/proto.RingService/GetWebsocketConnectionStatus"
|
||||
RingService_GetWebsocketConnectionStatusBatch_FullMethodName = "/proto.RingService/GetWebsocketConnectionStatusBatch"
|
||||
)
|
||||
|
||||
// RingServiceClient is the client API for RingService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// RingService provides methods to send various types of notifications.
|
||||
type RingServiceClient interface {
|
||||
// Sends an email.
|
||||
SendEmail(ctx context.Context, in *SendEmailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a user via WebSocket.
|
||||
PushWebSocketPacket(ctx context.Context, in *PushWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of users via WebSocket.
|
||||
PushWebSocketPacketToUsers(ctx context.Context, in *PushWebSocketPacketToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a device via WebSocket.
|
||||
PushWebSocketPacketToDevice(ctx context.Context, in *PushWebSocketPacketToDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of devices via WebSocket.
|
||||
PushWebSocketPacketToDevices(ctx context.Context, in *PushWebSocketPacketToDevicesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a user.
|
||||
SendPushNotificationToUser(ctx context.Context, in *SendPushNotificationToUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a list of users.
|
||||
SendPushNotificationToUsers(ctx context.Context, in *SendPushNotificationToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Unsubscribes a device from push notifications.
|
||||
UnsubscribePushNotifications(ctx context.Context, in *UnsubscribePushNotificationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Gets the WebSocket connection status for a device or user.
|
||||
GetWebsocketConnectionStatus(ctx context.Context, in *GetWebsocketConnectionStatusRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusResponse, error)
|
||||
GetWebsocketConnectionStatusBatch(ctx context.Context, in *GetWebsocketConnectionStatusBatchRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusBatchResponse, error)
|
||||
}
|
||||
|
||||
type ringServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRingServiceClient(cc grpc.ClientConnInterface) RingServiceClient {
|
||||
return &ringServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendEmail(ctx context.Context, in *SendEmailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacket(ctx context.Context, in *PushWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacket_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToUsers(ctx context.Context, in *PushWebSocketPacketToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToDevice(ctx context.Context, in *PushWebSocketPacketToDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToDevice_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToDevices(ctx context.Context, in *PushWebSocketPacketToDevicesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToDevices_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendPushNotificationToUser(ctx context.Context, in *SendPushNotificationToUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendPushNotificationToUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendPushNotificationToUsers(ctx context.Context, in *SendPushNotificationToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendPushNotificationToUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) UnsubscribePushNotifications(ctx context.Context, in *UnsubscribePushNotificationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_UnsubscribePushNotifications_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) GetWebsocketConnectionStatus(ctx context.Context, in *GetWebsocketConnectionStatusRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetWebsocketConnectionStatusResponse)
|
||||
err := c.cc.Invoke(ctx, RingService_GetWebsocketConnectionStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) GetWebsocketConnectionStatusBatch(ctx context.Context, in *GetWebsocketConnectionStatusBatchRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetWebsocketConnectionStatusBatchResponse)
|
||||
err := c.cc.Invoke(ctx, RingService_GetWebsocketConnectionStatusBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RingServiceServer is the server API for RingService service.
|
||||
// All implementations must embed UnimplementedRingServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// RingService provides methods to send various types of notifications.
|
||||
type RingServiceServer interface {
|
||||
// Sends an email.
|
||||
SendEmail(context.Context, *SendEmailRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a user via WebSocket.
|
||||
PushWebSocketPacket(context.Context, *PushWebSocketPacketRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of users via WebSocket.
|
||||
PushWebSocketPacketToUsers(context.Context, *PushWebSocketPacketToUsersRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a device via WebSocket.
|
||||
PushWebSocketPacketToDevice(context.Context, *PushWebSocketPacketToDeviceRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of devices via WebSocket.
|
||||
PushWebSocketPacketToDevices(context.Context, *PushWebSocketPacketToDevicesRequest) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a user.
|
||||
SendPushNotificationToUser(context.Context, *SendPushNotificationToUserRequest) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a list of users.
|
||||
SendPushNotificationToUsers(context.Context, *SendPushNotificationToUsersRequest) (*emptypb.Empty, error)
|
||||
// Unsubscribes a device from push notifications.
|
||||
UnsubscribePushNotifications(context.Context, *UnsubscribePushNotificationsRequest) (*emptypb.Empty, error)
|
||||
// Gets the WebSocket connection status for a device or user.
|
||||
GetWebsocketConnectionStatus(context.Context, *GetWebsocketConnectionStatusRequest) (*GetWebsocketConnectionStatusResponse, error)
|
||||
GetWebsocketConnectionStatusBatch(context.Context, *GetWebsocketConnectionStatusBatchRequest) (*GetWebsocketConnectionStatusBatchResponse, error)
|
||||
mustEmbedUnimplementedRingServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRingServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRingServiceServer struct{}
|
||||
|
||||
func (UnimplementedRingServiceServer) SendEmail(context.Context, *SendEmailRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendEmail not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacket(context.Context, *PushWebSocketPacketRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacket not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToUsers(context.Context, *PushWebSocketPacketToUsersRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToUsers not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToDevice(context.Context, *PushWebSocketPacketToDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToDevice not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToDevices(context.Context, *PushWebSocketPacketToDevicesRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToDevices not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) SendPushNotificationToUser(context.Context, *SendPushNotificationToUserRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendPushNotificationToUser not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) SendPushNotificationToUsers(context.Context, *SendPushNotificationToUsersRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendPushNotificationToUsers not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) UnsubscribePushNotifications(context.Context, *UnsubscribePushNotificationsRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnsubscribePushNotifications not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) GetWebsocketConnectionStatus(context.Context, *GetWebsocketConnectionStatusRequest) (*GetWebsocketConnectionStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWebsocketConnectionStatus not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) GetWebsocketConnectionStatusBatch(context.Context, *GetWebsocketConnectionStatusBatchRequest) (*GetWebsocketConnectionStatusBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWebsocketConnectionStatusBatch not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) mustEmbedUnimplementedRingServiceServer() {}
|
||||
func (UnimplementedRingServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RingServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRingServiceServer interface {
|
||||
mustEmbedUnimplementedRingServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRingServiceServer(s grpc.ServiceRegistrar, srv RingServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRingServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RingService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RingService_SendEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendEmailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendEmail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendEmail(ctx, req.(*SendEmailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacket(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacket_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacket(ctx, req.(*PushWebSocketPacketRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToUsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToUsers(ctx, req.(*PushWebSocketPacketToUsersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevice(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToDevice_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevice(ctx, req.(*PushWebSocketPacketToDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToDevicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevices(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToDevices_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevices(ctx, req.(*PushWebSocketPacketToDevicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_SendPushNotificationToUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendPushNotificationToUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendPushNotificationToUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUser(ctx, req.(*SendPushNotificationToUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_SendPushNotificationToUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendPushNotificationToUsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendPushNotificationToUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUsers(ctx, req.(*SendPushNotificationToUsersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_UnsubscribePushNotifications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnsubscribePushNotificationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).UnsubscribePushNotifications(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_UnsubscribePushNotifications_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).UnsubscribePushNotifications(ctx, req.(*UnsubscribePushNotificationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_GetWebsocketConnectionStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWebsocketConnectionStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_GetWebsocketConnectionStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatus(ctx, req.(*GetWebsocketConnectionStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_GetWebsocketConnectionStatusBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWebsocketConnectionStatusBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatusBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_GetWebsocketConnectionStatusBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatusBatch(ctx, req.(*GetWebsocketConnectionStatusBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RingService_ServiceDesc is the grpc.ServiceDesc for RingService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RingService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RingService",
|
||||
HandlerType: (*RingServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "SendEmail",
|
||||
Handler: _RingService_SendEmail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacket",
|
||||
Handler: _RingService_PushWebSocketPacket_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToUsers",
|
||||
Handler: _RingService_PushWebSocketPacketToUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToDevice",
|
||||
Handler: _RingService_PushWebSocketPacketToDevice_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToDevices",
|
||||
Handler: _RingService_PushWebSocketPacketToDevices_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendPushNotificationToUser",
|
||||
Handler: _RingService_SendPushNotificationToUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendPushNotificationToUsers",
|
||||
Handler: _RingService_SendPushNotificationToUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnsubscribePushNotifications",
|
||||
Handler: _RingService_UnsubscribePushNotifications_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWebsocketConnectionStatus",
|
||||
Handler: _RingService_GetWebsocketConnectionStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWebsocketConnectionStatusBatch",
|
||||
Handler: _RingService_GetWebsocketConnectionStatusBatch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ring.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
RingHandlerService_ReceiveWebSocketPacket_FullMethodName = "/proto.RingHandlerService/ReceiveWebSocketPacket"
|
||||
)
|
||||
|
||||
// RingHandlerServiceClient is the client API for RingHandlerService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RingHandlerServiceClient interface {
|
||||
ReceiveWebSocketPacket(ctx context.Context, in *ReceiveWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type ringHandlerServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRingHandlerServiceClient(cc grpc.ClientConnInterface) RingHandlerServiceClient {
|
||||
return &ringHandlerServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *ringHandlerServiceClient) ReceiveWebSocketPacket(ctx context.Context, in *ReceiveWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingHandlerService_ReceiveWebSocketPacket_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RingHandlerServiceServer is the server API for RingHandlerService service.
|
||||
// All implementations must embed UnimplementedRingHandlerServiceServer
|
||||
// for forward compatibility.
|
||||
type RingHandlerServiceServer interface {
|
||||
ReceiveWebSocketPacket(context.Context, *ReceiveWebSocketPacketRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedRingHandlerServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRingHandlerServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRingHandlerServiceServer struct{}
|
||||
|
||||
func (UnimplementedRingHandlerServiceServer) ReceiveWebSocketPacket(context.Context, *ReceiveWebSocketPacketRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ReceiveWebSocketPacket not implemented")
|
||||
}
|
||||
func (UnimplementedRingHandlerServiceServer) mustEmbedUnimplementedRingHandlerServiceServer() {}
|
||||
func (UnimplementedRingHandlerServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRingHandlerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RingHandlerServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRingHandlerServiceServer interface {
|
||||
mustEmbedUnimplementedRingHandlerServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRingHandlerServiceServer(s grpc.ServiceRegistrar, srv RingHandlerServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRingHandlerServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RingHandlerService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RingHandlerService_ReceiveWebSocketPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReceiveWebSocketPacketRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingHandlerServiceServer).ReceiveWebSocketPacket(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingHandlerService_ReceiveWebSocketPacket_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingHandlerServiceServer).ReceiveWebSocketPacket(ctx, req.(*ReceiveWebSocketPacketRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RingHandlerService_ServiceDesc is the grpc.ServiceDesc for RingHandlerService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RingHandlerService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RingHandlerService",
|
||||
HandlerType: (*RingHandlerServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ReceiveWebSocketPacket",
|
||||
Handler: _RingHandlerService_ReceiveWebSocketPacket_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ring.proto",
|
||||
}
|
||||
2809
pkg/shared/proto/gen/wallet.pb.go
Normal file
2809
pkg/shared/proto/gen/wallet.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
527
pkg/shared/proto/gen/wallet_grpc.pb.go
Normal file
527
pkg/shared/proto/gen/wallet_grpc.pb.go
Normal file
@@ -0,0 +1,527 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: wallet.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
WalletService_GetWallet_FullMethodName = "/proto.WalletService/GetWallet"
|
||||
WalletService_CreateWallet_FullMethodName = "/proto.WalletService/CreateWallet"
|
||||
WalletService_GetOrCreateWalletPocket_FullMethodName = "/proto.WalletService/GetOrCreateWalletPocket"
|
||||
)
|
||||
|
||||
// WalletServiceClient is the client API for WalletService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type WalletServiceClient interface {
|
||||
GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*Wallet, error)
|
||||
CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*Wallet, error)
|
||||
GetOrCreateWalletPocket(ctx context.Context, in *GetOrCreateWalletPocketRequest, opts ...grpc.CallOption) (*WalletPocket, error)
|
||||
}
|
||||
|
||||
type walletServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewWalletServiceClient(cc grpc.ClientConnInterface) WalletServiceClient {
|
||||
return &walletServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *walletServiceClient) GetWallet(ctx context.Context, in *GetWalletRequest, opts ...grpc.CallOption) (*Wallet, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Wallet)
|
||||
err := c.cc.Invoke(ctx, WalletService_GetWallet_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *walletServiceClient) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*Wallet, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Wallet)
|
||||
err := c.cc.Invoke(ctx, WalletService_CreateWallet_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *walletServiceClient) GetOrCreateWalletPocket(ctx context.Context, in *GetOrCreateWalletPocketRequest, opts ...grpc.CallOption) (*WalletPocket, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(WalletPocket)
|
||||
err := c.cc.Invoke(ctx, WalletService_GetOrCreateWalletPocket_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// WalletServiceServer is the server API for WalletService service.
|
||||
// All implementations must embed UnimplementedWalletServiceServer
|
||||
// for forward compatibility.
|
||||
type WalletServiceServer interface {
|
||||
GetWallet(context.Context, *GetWalletRequest) (*Wallet, error)
|
||||
CreateWallet(context.Context, *CreateWalletRequest) (*Wallet, error)
|
||||
GetOrCreateWalletPocket(context.Context, *GetOrCreateWalletPocketRequest) (*WalletPocket, error)
|
||||
mustEmbedUnimplementedWalletServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedWalletServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedWalletServiceServer struct{}
|
||||
|
||||
func (UnimplementedWalletServiceServer) GetWallet(context.Context, *GetWalletRequest) (*Wallet, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWallet not implemented")
|
||||
}
|
||||
func (UnimplementedWalletServiceServer) CreateWallet(context.Context, *CreateWalletRequest) (*Wallet, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateWallet not implemented")
|
||||
}
|
||||
func (UnimplementedWalletServiceServer) GetOrCreateWalletPocket(context.Context, *GetOrCreateWalletPocketRequest) (*WalletPocket, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetOrCreateWalletPocket not implemented")
|
||||
}
|
||||
func (UnimplementedWalletServiceServer) mustEmbedUnimplementedWalletServiceServer() {}
|
||||
func (UnimplementedWalletServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeWalletServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to WalletServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeWalletServiceServer interface {
|
||||
mustEmbedUnimplementedWalletServiceServer()
|
||||
}
|
||||
|
||||
func RegisterWalletServiceServer(s grpc.ServiceRegistrar, srv WalletServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedWalletServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&WalletService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _WalletService_GetWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWalletRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WalletServiceServer).GetWallet(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: WalletService_GetWallet_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WalletServiceServer).GetWallet(ctx, req.(*GetWalletRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WalletService_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateWalletRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WalletServiceServer).CreateWallet(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: WalletService_CreateWallet_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WalletServiceServer).CreateWallet(ctx, req.(*CreateWalletRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _WalletService_GetOrCreateWalletPocket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetOrCreateWalletPocketRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WalletServiceServer).GetOrCreateWalletPocket(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: WalletService_GetOrCreateWalletPocket_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WalletServiceServer).GetOrCreateWalletPocket(ctx, req.(*GetOrCreateWalletPocketRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// WalletService_ServiceDesc is the grpc.ServiceDesc for WalletService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var WalletService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.WalletService",
|
||||
HandlerType: (*WalletServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetWallet",
|
||||
Handler: _WalletService_GetWallet_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateWallet",
|
||||
Handler: _WalletService_CreateWallet_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetOrCreateWalletPocket",
|
||||
Handler: _WalletService_GetOrCreateWalletPocket_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "wallet.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
PaymentService_CreateOrder_FullMethodName = "/proto.PaymentService/CreateOrder"
|
||||
PaymentService_CreateTransactionWithAccount_FullMethodName = "/proto.PaymentService/CreateTransactionWithAccount"
|
||||
PaymentService_CreateTransaction_FullMethodName = "/proto.PaymentService/CreateTransaction"
|
||||
PaymentService_CancelOrder_FullMethodName = "/proto.PaymentService/CancelOrder"
|
||||
PaymentService_RefundOrder_FullMethodName = "/proto.PaymentService/RefundOrder"
|
||||
PaymentService_Transfer_FullMethodName = "/proto.PaymentService/Transfer"
|
||||
PaymentService_GetWalletFund_FullMethodName = "/proto.PaymentService/GetWalletFund"
|
||||
)
|
||||
|
||||
// PaymentServiceClient is the client API for PaymentService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PaymentServiceClient interface {
|
||||
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Order, error)
|
||||
CreateTransactionWithAccount(ctx context.Context, in *CreateTransactionWithAccountRequest, opts ...grpc.CallOption) (*Transaction, error)
|
||||
CreateTransaction(ctx context.Context, in *CreateTransactionRequest, opts ...grpc.CallOption) (*Transaction, error)
|
||||
CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Order, error)
|
||||
RefundOrder(ctx context.Context, in *RefundOrderRequest, opts ...grpc.CallOption) (*RefundOrderResponse, error)
|
||||
Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*Transaction, error)
|
||||
GetWalletFund(ctx context.Context, in *GetWalletFundRequest, opts ...grpc.CallOption) (*WalletFund, error)
|
||||
}
|
||||
|
||||
type paymentServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient {
|
||||
return &paymentServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Order, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Order)
|
||||
err := c.cc.Invoke(ctx, PaymentService_CreateOrder_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) CreateTransactionWithAccount(ctx context.Context, in *CreateTransactionWithAccountRequest, opts ...grpc.CallOption) (*Transaction, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Transaction)
|
||||
err := c.cc.Invoke(ctx, PaymentService_CreateTransactionWithAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) CreateTransaction(ctx context.Context, in *CreateTransactionRequest, opts ...grpc.CallOption) (*Transaction, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Transaction)
|
||||
err := c.cc.Invoke(ctx, PaymentService_CreateTransaction_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Order, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Order)
|
||||
err := c.cc.Invoke(ctx, PaymentService_CancelOrder_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) RefundOrder(ctx context.Context, in *RefundOrderRequest, opts ...grpc.CallOption) (*RefundOrderResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RefundOrderResponse)
|
||||
err := c.cc.Invoke(ctx, PaymentService_RefundOrder_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*Transaction, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Transaction)
|
||||
err := c.cc.Invoke(ctx, PaymentService_Transfer_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *paymentServiceClient) GetWalletFund(ctx context.Context, in *GetWalletFundRequest, opts ...grpc.CallOption) (*WalletFund, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(WalletFund)
|
||||
err := c.cc.Invoke(ctx, PaymentService_GetWalletFund_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PaymentServiceServer is the server API for PaymentService service.
|
||||
// All implementations must embed UnimplementedPaymentServiceServer
|
||||
// for forward compatibility.
|
||||
type PaymentServiceServer interface {
|
||||
CreateOrder(context.Context, *CreateOrderRequest) (*Order, error)
|
||||
CreateTransactionWithAccount(context.Context, *CreateTransactionWithAccountRequest) (*Transaction, error)
|
||||
CreateTransaction(context.Context, *CreateTransactionRequest) (*Transaction, error)
|
||||
CancelOrder(context.Context, *CancelOrderRequest) (*Order, error)
|
||||
RefundOrder(context.Context, *RefundOrderRequest) (*RefundOrderResponse, error)
|
||||
Transfer(context.Context, *TransferRequest) (*Transaction, error)
|
||||
GetWalletFund(context.Context, *GetWalletFundRequest) (*WalletFund, error)
|
||||
mustEmbedUnimplementedPaymentServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPaymentServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPaymentServiceServer struct{}
|
||||
|
||||
func (UnimplementedPaymentServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*Order, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateOrder not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) CreateTransactionWithAccount(context.Context, *CreateTransactionWithAccountRequest) (*Transaction, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateTransactionWithAccount not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) CreateTransaction(context.Context, *CreateTransactionRequest) (*Transaction, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateTransaction not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*Order, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CancelOrder not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) RefundOrder(context.Context, *RefundOrderRequest) (*RefundOrderResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RefundOrder not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) Transfer(context.Context, *TransferRequest) (*Transaction, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Transfer not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) GetWalletFund(context.Context, *GetWalletFundRequest) (*WalletFund, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWalletFund not implemented")
|
||||
}
|
||||
func (UnimplementedPaymentServiceServer) mustEmbedUnimplementedPaymentServiceServer() {}
|
||||
func (UnimplementedPaymentServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PaymentServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePaymentServiceServer interface {
|
||||
mustEmbedUnimplementedPaymentServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedPaymentServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PaymentService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PaymentService_CreateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateOrderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).CreateOrder(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_CreateOrder_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).CreateOrder(ctx, req.(*CreateOrderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_CreateTransactionWithAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateTransactionWithAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).CreateTransactionWithAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_CreateTransactionWithAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).CreateTransactionWithAccount(ctx, req.(*CreateTransactionWithAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_CreateTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateTransactionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).CreateTransaction(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_CreateTransaction_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).CreateTransaction(ctx, req.(*CreateTransactionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CancelOrderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).CancelOrder(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_CancelOrder_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_RefundOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RefundOrderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).RefundOrder(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_RefundOrder_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).RefundOrder(ctx, req.(*RefundOrderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TransferRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).Transfer(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_Transfer_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).Transfer(ctx, req.(*TransferRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PaymentService_GetWalletFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWalletFundRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PaymentServiceServer).GetWalletFund(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PaymentService_GetWalletFund_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PaymentServiceServer).GetWalletFund(ctx, req.(*GetWalletFundRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PaymentService_ServiceDesc is the grpc.ServiceDesc for PaymentService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PaymentService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.PaymentService",
|
||||
HandlerType: (*PaymentServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateOrder",
|
||||
Handler: _PaymentService_CreateOrder_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateTransactionWithAccount",
|
||||
Handler: _PaymentService_CreateTransactionWithAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateTransaction",
|
||||
Handler: _PaymentService_CreateTransaction_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CancelOrder",
|
||||
Handler: _PaymentService_CancelOrder_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RefundOrder",
|
||||
Handler: _PaymentService_RefundOrder_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Transfer",
|
||||
Handler: _PaymentService_Transfer_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWalletFund",
|
||||
Handler: _PaymentService_GetWalletFund_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "wallet.proto",
|
||||
}
|
||||
84
pkg/shared/proto/leveling.proto
Normal file
84
pkg/shared/proto/leveling.proto
Normal file
@@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// ====================================
|
||||
// Message Definitions
|
||||
// ====================================
|
||||
|
||||
// SocialCreditRecord represents a record of social credit changes for an account
|
||||
message SocialCreditRecord {
|
||||
string id = 1; // UUID string
|
||||
string reason_type = 2;
|
||||
string reason = 3;
|
||||
double delta = 4;
|
||||
string account_id = 5; // UUID string
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
|
||||
// ExperienceRecord represents a record of experience points gained by an account
|
||||
message ExperienceRecord {
|
||||
string id = 1; // UUID string
|
||||
string reason_type = 2;
|
||||
string reason = 3;
|
||||
int64 delta = 4;
|
||||
double bonus_multiplier = 5;
|
||||
string account_id = 6; // UUID string
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Request/Response Messages
|
||||
// ====================================
|
||||
|
||||
// Social Credit Requests/Responses
|
||||
message AddSocialCreditRecordRequest {
|
||||
string reason_type = 1;
|
||||
string reason = 2;
|
||||
double delta = 3;
|
||||
string account_id = 4; // UUID string
|
||||
google.protobuf.Timestamp expired_at = 5;
|
||||
}
|
||||
|
||||
message GetSocialCreditRequest {
|
||||
string account_id = 1; // UUID string
|
||||
}
|
||||
|
||||
message SocialCreditResponse {
|
||||
double amount = 1;
|
||||
}
|
||||
|
||||
// Experience Requests/Responses
|
||||
message AddExperienceRecordRequest {
|
||||
string reason_type = 1;
|
||||
string reason = 2;
|
||||
int64 delta = 3;
|
||||
string account_id = 4; // UUID string
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Service Definitions
|
||||
// ====================================
|
||||
|
||||
// SocialCreditService provides operations for managing social credit scores
|
||||
service SocialCreditService {
|
||||
// Adds a new social credit record for an account
|
||||
rpc AddRecord(AddSocialCreditRecordRequest) returns (SocialCreditRecord);
|
||||
|
||||
// Gets the current social credit score for an account
|
||||
rpc GetSocialCredit(GetSocialCreditRequest) returns (SocialCreditResponse);
|
||||
}
|
||||
|
||||
// ExperienceService provides operations for managing experience points
|
||||
service ExperienceService {
|
||||
// Adds a new experience record for an account
|
||||
rpc AddRecord(AddExperienceRecordRequest) returns (ExperienceRecord);
|
||||
}
|
||||
289
pkg/shared/proto/post.proto
Normal file
289
pkg/shared/proto/post.proto
Normal file
@@ -0,0 +1,289 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "file.proto";
|
||||
import "realm.proto";
|
||||
import "publisher.proto";
|
||||
|
||||
// Enums
|
||||
enum PostType {
|
||||
POST_TYPE_UNSPECIFIED = 0;
|
||||
MOMENT = 1;
|
||||
ARTICLE = 2;
|
||||
}
|
||||
|
||||
enum PostVisibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
PUBLIC = 1;
|
||||
FRIENDS = 2;
|
||||
UNLISTED = 3;
|
||||
PRIVATE = 4;
|
||||
}
|
||||
|
||||
enum PostPinMode {
|
||||
PIN_MODE_UNSPECIFIED = 0;
|
||||
PUBLISHER_PAGE = 1;
|
||||
REALM_PAGE = 2;
|
||||
REPLY_PAGE = 3;
|
||||
}
|
||||
|
||||
enum ContentSensitiveMark {
|
||||
SENSITIVE_MARK_UNSPECIFIED = 0;
|
||||
LANGUAGE = 1;
|
||||
SEXUAL_CONTENT = 2;
|
||||
VIOLENCE = 3;
|
||||
PROFANITY = 4;
|
||||
HATE_SPEECH = 5;
|
||||
RACISM = 6;
|
||||
ADULT_CONTENT = 7;
|
||||
DRUG_ABUSE = 8;
|
||||
ALCOHOL_ABUSE = 9;
|
||||
GAMBLING = 10;
|
||||
SELF_HARM = 11;
|
||||
CHILD_ABUSE = 12;
|
||||
OTHER = 13;
|
||||
}
|
||||
|
||||
enum PostReactionAttitude {
|
||||
ATTITUDE_UNSPECIFIED = 0;
|
||||
POST_ATTITUDE_POSITIVE = 1;
|
||||
POST_ATTITUDE_NEUTRAL = 2;
|
||||
POST_ATTITUDE_NEGATIVE = 3;
|
||||
}
|
||||
|
||||
enum PostEmbedViewRenderer {
|
||||
RENDERER_UNSPECIFIED = 0;
|
||||
WEBVIEW = 1;
|
||||
}
|
||||
|
||||
// Messages
|
||||
|
||||
message PostEmbedView {
|
||||
string uri = 1;
|
||||
optional double aspect_ratio = 2;
|
||||
PostEmbedViewRenderer renderer = 3;
|
||||
}
|
||||
|
||||
message Post {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string slug = 4;
|
||||
optional google.protobuf.Timestamp edited_at = 5;
|
||||
optional google.protobuf.Timestamp published_at = 6;
|
||||
PostVisibility visibility = 7;
|
||||
optional string content = 8;
|
||||
|
||||
PostType type = 9;
|
||||
optional PostPinMode pin_mode = 10;
|
||||
optional bytes meta = 11; // Dictionary<string, object>
|
||||
optional bytes sensitive_marks = 12; // List<ContentSensitiveMark>
|
||||
optional PostEmbedView embed_view = 13;
|
||||
|
||||
int32 views_unique = 14;
|
||||
int32 views_total = 15;
|
||||
int32 upvotes = 16;
|
||||
int32 downvotes = 17;
|
||||
double awarded_score = 18;
|
||||
|
||||
// Not mapped fields: handled client-side
|
||||
map<string, int32> reactions_count = 19; // Dictionary<string, int>
|
||||
int32 replies_count = 20;
|
||||
map<string, bool> reactions_made = 21; // Dictionary<string, bool>
|
||||
|
||||
bool replied_gone = 22;
|
||||
bool forwarded_gone = 23;
|
||||
|
||||
optional string replied_post_id = 24;
|
||||
optional Post replied_post = 25; // full if populated
|
||||
optional string forwarded_post_id = 26;
|
||||
optional Post forwarded_post = 27; // full if populated
|
||||
|
||||
optional string realm_id = 28;
|
||||
optional Realm realm = 29; // full if populated
|
||||
|
||||
repeated CloudFile attachments = 30; // List<SnCloudFileReferenceObject>
|
||||
|
||||
string publisher_id = 31;
|
||||
Publisher publisher = 32;
|
||||
|
||||
repeated PostAward awards = 33;
|
||||
repeated PostReaction reactions = 34;
|
||||
repeated PostTag tags = 35;
|
||||
repeated PostCategory categories = 36;
|
||||
repeated PostFeaturedRecord featured_records = 37;
|
||||
|
||||
// Added for ToActivity
|
||||
google.protobuf.Timestamp created_at = 38;
|
||||
google.protobuf.Timestamp updated_at = 39;
|
||||
optional google.protobuf.Timestamp deleted_at = 40;
|
||||
}
|
||||
|
||||
message PostTag {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
string name = 3;
|
||||
|
||||
google.protobuf.Timestamp created_at = 4;
|
||||
google.protobuf.Timestamp updated_at = 5;
|
||||
}
|
||||
|
||||
message PostCategory {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
string name = 3;
|
||||
|
||||
google.protobuf.Timestamp created_at = 4;
|
||||
google.protobuf.Timestamp updated_at = 5;
|
||||
}
|
||||
|
||||
message PostCategorySubscription {
|
||||
string id = 1;
|
||||
string account_id = 2;
|
||||
|
||||
optional string category_id = 3;
|
||||
optional PostCategory category = 4;
|
||||
optional string tag_id = 5;
|
||||
optional PostTag tag = 6;
|
||||
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
message PostCollection {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
optional google.protobuf.StringValue name = 3;
|
||||
optional google.protobuf.StringValue description = 4;
|
||||
|
||||
Publisher publisher = 5;
|
||||
optional string publisher_id = 6; // for cases where full publisher not needed
|
||||
|
||||
repeated Post posts = 7;
|
||||
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
google.protobuf.Timestamp updated_at = 9;
|
||||
}
|
||||
|
||||
message PostFeaturedRecord {
|
||||
string id = 1;
|
||||
string post_id = 2;
|
||||
optional google.protobuf.Timestamp featured_at = 3;
|
||||
int32 social_credits = 4;
|
||||
|
||||
google.protobuf.Timestamp created_at = 5;
|
||||
google.protobuf.Timestamp updated_at = 6;
|
||||
}
|
||||
|
||||
message PostReaction {
|
||||
string id = 1;
|
||||
string symbol = 2;
|
||||
PostReactionAttitude attitude = 3;
|
||||
|
||||
string post_id = 4;
|
||||
string account_id = 5;
|
||||
optional Account account = 6; // optional full account
|
||||
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
message PostAward {
|
||||
string id = 1;
|
||||
double amount = 2;
|
||||
PostReactionAttitude attitude = 3;
|
||||
optional google.protobuf.StringValue message = 4;
|
||||
|
||||
string post_id = 5;
|
||||
string account_id = 6;
|
||||
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Request/Response Messages
|
||||
// ====================================
|
||||
|
||||
message GetPostRequest {
|
||||
oneof identifier {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
}
|
||||
google.protobuf.StringValue publisher_id = 3;
|
||||
}
|
||||
|
||||
message GetPostBatchRequest {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
message GetPostBatchResponse {
|
||||
repeated Post posts = 1;
|
||||
}
|
||||
|
||||
message SearchPostsRequest {
|
||||
string query = 1;
|
||||
string publisher_id = 2;
|
||||
string realm_id = 3;
|
||||
int32 page_size = 4;
|
||||
string page_token = 5;
|
||||
string order_by = 6;
|
||||
}
|
||||
|
||||
message SearchPostsResponse {
|
||||
repeated Post posts = 1;
|
||||
string next_page_token = 2;
|
||||
int32 total_size = 3;
|
||||
}
|
||||
|
||||
message ListPostsRequest {
|
||||
google.protobuf.StringValue publisher_id = 1;
|
||||
google.protobuf.StringValue realm_id = 2;
|
||||
int32 page_size = 3;
|
||||
string page_token = 4;
|
||||
google.protobuf.StringValue order_by = 5;
|
||||
bool order_desc = 16;
|
||||
repeated string categories = 6;
|
||||
repeated string tags = 7;
|
||||
google.protobuf.StringValue query = 8;
|
||||
repeated PostType types = 9;
|
||||
optional google.protobuf.Timestamp after = 10; // Filter posts created after this timestamp
|
||||
optional google.protobuf.Timestamp before = 11; // Filter posts created before this timestamp
|
||||
bool include_replies = 12; // Include reply posts
|
||||
optional PostPinMode pinned = 13; // Filter by pinned mode (if present, null means not pinned)
|
||||
bool only_media = 14; // Only return posts with attachments
|
||||
bool shuffle = 15; // Random order
|
||||
}
|
||||
|
||||
message ListPostsResponse {
|
||||
repeated Post posts = 1;
|
||||
string next_page_token = 2;
|
||||
int32 total_size = 3;
|
||||
}
|
||||
|
||||
// ====================================
|
||||
// Service Definitions
|
||||
// ====================================
|
||||
|
||||
service PostService {
|
||||
// Get a single post by id
|
||||
rpc GetPost(GetPostRequest) returns (Post);
|
||||
|
||||
// Get multiple posts by ids
|
||||
rpc GetPostBatch(GetPostBatchRequest) returns (GetPostBatchResponse);
|
||||
|
||||
// Search posts
|
||||
rpc SearchPosts(SearchPostsRequest) returns (SearchPostsResponse);
|
||||
|
||||
// List posts with filters
|
||||
rpc ListPosts(ListPostsRequest) returns (ListPostsResponse);
|
||||
}
|
||||
|
||||
import 'account.proto';
|
||||
125
pkg/shared/proto/publisher.proto
Normal file
125
pkg/shared/proto/publisher.proto
Normal file
@@ -0,0 +1,125 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "file.proto";
|
||||
import "account.proto";
|
||||
|
||||
enum PublisherType {
|
||||
PUBLISHER_TYPE_UNSPECIFIED = 0;
|
||||
PUB_INDIVIDUAL = 1;
|
||||
PUB_ORGANIZATIONAL = 2;
|
||||
}
|
||||
|
||||
enum PublisherMemberRole {
|
||||
PUBLISHER_MEMBER_ROLE_UNSPECIFIED = 0;
|
||||
OWNER = 100;
|
||||
MANAGER = 75;
|
||||
EDITOR = 50;
|
||||
VIEWER = 25;
|
||||
}
|
||||
|
||||
message PublisherFeature {
|
||||
string id = 1;
|
||||
string flag = 2;
|
||||
google.protobuf.Timestamp expired_at = 3;
|
||||
string publisher_id = 4;
|
||||
google.protobuf.Timestamp created_at = 5;
|
||||
google.protobuf.Timestamp updated_at = 6;
|
||||
}
|
||||
|
||||
message PublisherMember {
|
||||
string publisher_id = 1;
|
||||
string account_id = 2;
|
||||
PublisherMemberRole role = 3;
|
||||
google.protobuf.Timestamp joined_at = 4;
|
||||
google.protobuf.Timestamp created_at = 5;
|
||||
google.protobuf.Timestamp updated_at = 6;
|
||||
}
|
||||
|
||||
message Publisher {
|
||||
string id = 1;
|
||||
PublisherType type = 2;
|
||||
string name = 3;
|
||||
string nick = 4;
|
||||
google.protobuf.StringValue bio = 5;
|
||||
CloudFile picture = 8;
|
||||
CloudFile background = 9;
|
||||
optional VerificationMark verification_mark = 10;
|
||||
string account_id = 11;
|
||||
optional string realm_id = 12;
|
||||
google.protobuf.Timestamp created_at = 13;
|
||||
google.protobuf.Timestamp updated_at = 14;
|
||||
}
|
||||
|
||||
message GetPublisherRequest {
|
||||
oneof query {
|
||||
string name = 1;
|
||||
string id = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message GetPublisherResponse {
|
||||
Publisher publisher = 1;
|
||||
}
|
||||
|
||||
message GetPublisherBatchRequest {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
message ListPublishersRequest {
|
||||
string account_id = 1; // filter by owner/member account
|
||||
string realm_id = 2; // filter by realm
|
||||
}
|
||||
|
||||
message ListPublishersResponse {
|
||||
repeated Publisher publishers = 1;
|
||||
}
|
||||
|
||||
message ListPublisherMembersRequest {
|
||||
string publisher_id = 1;
|
||||
}
|
||||
|
||||
message ListPublisherMembersResponse {
|
||||
repeated PublisherMember members = 1;
|
||||
}
|
||||
|
||||
message SetPublisherFeatureFlagRequest {
|
||||
string publisher_id = 1;
|
||||
string flag = 2;
|
||||
}
|
||||
|
||||
message HasPublisherFeatureRequest {
|
||||
string publisher_id = 1;
|
||||
string flag = 2;
|
||||
}
|
||||
|
||||
message HasPublisherFeatureResponse {
|
||||
bool enabled = 1;
|
||||
}
|
||||
|
||||
message IsPublisherMemberRequest {
|
||||
string publisher_id = 1;
|
||||
string account_id = 2;
|
||||
PublisherMemberRole role = 3;
|
||||
}
|
||||
|
||||
message IsPublisherMemberResponse {
|
||||
bool valid = 1;
|
||||
}
|
||||
|
||||
service PublisherService {
|
||||
rpc GetPublisher(GetPublisherRequest) returns (GetPublisherResponse);
|
||||
rpc GetPublisherBatch(GetPublisherBatchRequest) returns (ListPublishersResponse);
|
||||
rpc ListPublishers(ListPublishersRequest) returns (ListPublishersResponse);
|
||||
rpc ListPublisherMembers(ListPublisherMembersRequest) returns (ListPublisherMembersResponse);
|
||||
rpc SetPublisherFeatureFlag(SetPublisherFeatureFlagRequest) returns (google.protobuf.StringValue); // returns optional message
|
||||
rpc HasPublisherFeature(HasPublisherFeatureRequest) returns (HasPublisherFeatureResponse);
|
||||
rpc IsPublisherMember(IsPublisherMemberRequest) returns (IsPublisherMemberResponse);
|
||||
}
|
||||
122
pkg/shared/proto/realm.proto
Normal file
122
pkg/shared/proto/realm.proto
Normal file
@@ -0,0 +1,122 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
import 'account.proto';
|
||||
import "file.proto";
|
||||
|
||||
// Message Definitions
|
||||
|
||||
message Realm {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string slug = 3;
|
||||
bool is_community = 4;
|
||||
bool is_public = 5;
|
||||
string description = 6;
|
||||
optional CloudFile picture = 7;
|
||||
optional CloudFile background = 8;
|
||||
optional VerificationMark verification = 9;
|
||||
string account_id = 10;
|
||||
}
|
||||
|
||||
message RealmMember {
|
||||
string account_id = 1;
|
||||
string realm_id = 2;
|
||||
int32 role = 3;
|
||||
optional google.protobuf.Timestamp joined_at = 4;
|
||||
optional google.protobuf.Timestamp leave_at = 5;
|
||||
optional Account account = 6;
|
||||
optional Realm realm = 7;
|
||||
}
|
||||
|
||||
// Service Definitions
|
||||
|
||||
service RealmService {
|
||||
// Get realm by id or slug
|
||||
rpc GetRealm(GetRealmRequest) returns (Realm) {}
|
||||
// Get realm batch by ids
|
||||
rpc GetRealmBatch(GetRealmBatchRequest) returns (GetRealmBatchResponse) {}
|
||||
// Get realms for a user
|
||||
rpc GetUserRealms(GetUserRealmsRequest) returns (GetUserRealmsResponse) {}
|
||||
// Get public realms
|
||||
rpc GetPublicRealms(GetPublicRealmsRequest) returns (GetPublicRealmsResponse) {}
|
||||
// Search public realms
|
||||
rpc SearchRealms(SearchRealmsRequest) returns (GetPublicRealmsResponse) {}
|
||||
// Send invitation notification
|
||||
rpc SendInviteNotify(SendInviteNotifyRequest) returns (google.protobuf.Empty) {}
|
||||
// Check if member has required role
|
||||
rpc IsMemberWithRole(IsMemberWithRoleRequest) returns (google.protobuf.BoolValue) {}
|
||||
// Load account for a member
|
||||
rpc LoadMemberAccount(LoadMemberAccountRequest) returns (RealmMember) {}
|
||||
// Load accounts for members
|
||||
rpc LoadMemberAccounts(LoadMemberAccountsRequest) returns (LoadMemberAccountsResponse) {}
|
||||
}
|
||||
|
||||
// Request/Response Messages
|
||||
|
||||
message GetRealmRequest {
|
||||
oneof query {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message GetUserRealmsRequest {
|
||||
string account_id = 1;
|
||||
}
|
||||
|
||||
message GetRealmBatchRequest {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
message GetRealmBatchResponse {
|
||||
repeated Realm realms = 1;
|
||||
}
|
||||
|
||||
message GetUserRealmsResponse {
|
||||
repeated string realm_ids = 1;
|
||||
}
|
||||
|
||||
message GetPublicRealmsRequest {
|
||||
optional string order_by = 1;
|
||||
}
|
||||
|
||||
message GetPublicRealmsResponse {
|
||||
repeated Realm realms = 1;
|
||||
}
|
||||
|
||||
message SearchRealmsRequest {
|
||||
string query = 1;
|
||||
int32 limit = 2;
|
||||
}
|
||||
|
||||
message SendInviteNotifyRequest {
|
||||
RealmMember member = 1;
|
||||
}
|
||||
|
||||
message IsMemberWithRoleRequest {
|
||||
string realm_id = 1;
|
||||
string account_id = 2;
|
||||
repeated int32 required_roles = 3;
|
||||
}
|
||||
|
||||
message LoadMemberAccountRequest {
|
||||
RealmMember member = 1;
|
||||
}
|
||||
|
||||
message LoadMemberAccountsRequest {
|
||||
repeated RealmMember members = 1;
|
||||
}
|
||||
|
||||
message LoadMemberAccountsResponse {
|
||||
repeated RealmMember members = 1;
|
||||
}
|
||||
1322
pkg/shared/proto/ring.pb.go
Normal file
1322
pkg/shared/proto/ring.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
157
pkg/shared/proto/ring.proto
Normal file
157
pkg/shared/proto/ring.proto
Normal file
@@ -0,0 +1,157 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
import "account.proto";
|
||||
|
||||
// RingService provides methods to send various types of notifications.
|
||||
service RingService {
|
||||
// Sends an email.
|
||||
rpc SendEmail(SendEmailRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Pushes a packet to a user via WebSocket.
|
||||
rpc PushWebSocketPacket(PushWebSocketPacketRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Pushes a packet to a list of users via WebSocket.
|
||||
rpc PushWebSocketPacketToUsers(PushWebSocketPacketToUsersRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Pushes a packet to a device via WebSocket.
|
||||
rpc PushWebSocketPacketToDevice(PushWebSocketPacketToDeviceRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Pushes a packet to a list of devices via WebSocket.
|
||||
rpc PushWebSocketPacketToDevices(PushWebSocketPacketToDevicesRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Sends a push notification to a user.
|
||||
rpc SendPushNotificationToUser(SendPushNotificationToUserRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Sends a push notification to a list of users.
|
||||
rpc SendPushNotificationToUsers(SendPushNotificationToUsersRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Unsubscribes a device from push notifications.
|
||||
rpc UnsubscribePushNotifications(UnsubscribePushNotificationsRequest) returns (google.protobuf.Empty) {}
|
||||
|
||||
// Gets the WebSocket connection status for a device or user.
|
||||
rpc GetWebsocketConnectionStatus(GetWebsocketConnectionStatusRequest) returns (GetWebsocketConnectionStatusResponse) {}
|
||||
|
||||
rpc GetWebsocketConnectionStatusBatch(GetWebsocketConnectionStatusBatchRequest) returns (GetWebsocketConnectionStatusBatchResponse) {}
|
||||
}
|
||||
|
||||
// Represents an email message.
|
||||
message EmailMessage {
|
||||
string to_name = 1;
|
||||
string to_address = 2;
|
||||
string subject = 3;
|
||||
string body = 4;
|
||||
}
|
||||
|
||||
message SendEmailRequest {
|
||||
EmailMessage email = 1;
|
||||
}
|
||||
|
||||
// Represents a WebSocket packet.
|
||||
message WebSocketPacket {
|
||||
string type = 1;
|
||||
bytes data = 2;
|
||||
google.protobuf.StringValue error_message = 3;
|
||||
}
|
||||
|
||||
message PushWebSocketPacketRequest {
|
||||
string user_id = 1;
|
||||
WebSocketPacket packet = 2;
|
||||
}
|
||||
|
||||
message PushWebSocketPacketToUsersRequest {
|
||||
repeated string user_ids = 1;
|
||||
WebSocketPacket packet = 2;
|
||||
}
|
||||
|
||||
message PushWebSocketPacketToDeviceRequest {
|
||||
string device_id = 1;
|
||||
WebSocketPacket packet = 2;
|
||||
}
|
||||
|
||||
message PushWebSocketPacketToDevicesRequest {
|
||||
repeated string device_ids = 1;
|
||||
WebSocketPacket packet = 2;
|
||||
}
|
||||
|
||||
// Represents a push notification.
|
||||
message PushNotification {
|
||||
string topic = 1;
|
||||
string title = 2;
|
||||
string subtitle = 3;
|
||||
string body = 4;
|
||||
optional bytes meta = 5;
|
||||
optional string action_uri = 6;
|
||||
bool is_silent = 7;
|
||||
bool is_savable = 8;
|
||||
}
|
||||
|
||||
message SendPushNotificationToUserRequest {
|
||||
string user_id = 1;
|
||||
PushNotification notification = 2;
|
||||
}
|
||||
|
||||
message SendPushNotificationToUsersRequest {
|
||||
repeated string user_ids = 1;
|
||||
PushNotification notification = 2;
|
||||
}
|
||||
|
||||
message UnsubscribePushNotificationsRequest {
|
||||
string device_id = 1;
|
||||
}
|
||||
|
||||
message GetWebsocketConnectionStatusRequest {
|
||||
oneof id {
|
||||
string device_id = 1;
|
||||
string user_id = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message GetWebsocketConnectionStatusResponse {
|
||||
bool is_connected = 1;
|
||||
}
|
||||
|
||||
message GetWebsocketConnectionStatusBatchRequest {
|
||||
repeated string users_id = 1;
|
||||
}
|
||||
|
||||
message GetWebsocketConnectionStatusBatchResponse {
|
||||
map<string, bool> is_connected = 1;
|
||||
}
|
||||
|
||||
service RingHandlerService {
|
||||
rpc ReceiveWebSocketPacket(ReceiveWebSocketPacketRequest) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
message ReceiveWebSocketPacketRequest {
|
||||
WebSocketPacket packet = 1;
|
||||
Account account = 2;
|
||||
string device_id = 3;
|
||||
}
|
||||
|
||||
// WebSocket event messages for NATS publishing
|
||||
message WebSocketConnectedEvent {
|
||||
google.protobuf.StringValue account_id = 1;
|
||||
string device_id = 2;
|
||||
bool is_offline = 3;
|
||||
}
|
||||
|
||||
message WebSocketDisconnectedEvent {
|
||||
google.protobuf.StringValue account_id = 1;
|
||||
string device_id = 2;
|
||||
bool is_offline = 3;
|
||||
}
|
||||
|
||||
message WebSocketPacketEvent {
|
||||
google.protobuf.StringValue account_id = 1;
|
||||
string device_id = 2;
|
||||
bytes packet_bytes = 3;
|
||||
}
|
||||
588
pkg/shared/proto/ring_grpc.pb.go
Normal file
588
pkg/shared/proto/ring_grpc.pb.go
Normal file
@@ -0,0 +1,588 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.0
|
||||
// - protoc v6.33.1
|
||||
// source: ring.proto
|
||||
|
||||
package gen
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RingService_SendEmail_FullMethodName = "/proto.RingService/SendEmail"
|
||||
RingService_PushWebSocketPacket_FullMethodName = "/proto.RingService/PushWebSocketPacket"
|
||||
RingService_PushWebSocketPacketToUsers_FullMethodName = "/proto.RingService/PushWebSocketPacketToUsers"
|
||||
RingService_PushWebSocketPacketToDevice_FullMethodName = "/proto.RingService/PushWebSocketPacketToDevice"
|
||||
RingService_PushWebSocketPacketToDevices_FullMethodName = "/proto.RingService/PushWebSocketPacketToDevices"
|
||||
RingService_SendPushNotificationToUser_FullMethodName = "/proto.RingService/SendPushNotificationToUser"
|
||||
RingService_SendPushNotificationToUsers_FullMethodName = "/proto.RingService/SendPushNotificationToUsers"
|
||||
RingService_UnsubscribePushNotifications_FullMethodName = "/proto.RingService/UnsubscribePushNotifications"
|
||||
RingService_GetWebsocketConnectionStatus_FullMethodName = "/proto.RingService/GetWebsocketConnectionStatus"
|
||||
RingService_GetWebsocketConnectionStatusBatch_FullMethodName = "/proto.RingService/GetWebsocketConnectionStatusBatch"
|
||||
)
|
||||
|
||||
// RingServiceClient is the client API for RingService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// RingService provides methods to send various types of notifications.
|
||||
type RingServiceClient interface {
|
||||
// Sends an email.
|
||||
SendEmail(ctx context.Context, in *SendEmailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a user via WebSocket.
|
||||
PushWebSocketPacket(ctx context.Context, in *PushWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of users via WebSocket.
|
||||
PushWebSocketPacketToUsers(ctx context.Context, in *PushWebSocketPacketToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a device via WebSocket.
|
||||
PushWebSocketPacketToDevice(ctx context.Context, in *PushWebSocketPacketToDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of devices via WebSocket.
|
||||
PushWebSocketPacketToDevices(ctx context.Context, in *PushWebSocketPacketToDevicesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a user.
|
||||
SendPushNotificationToUser(ctx context.Context, in *SendPushNotificationToUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a list of users.
|
||||
SendPushNotificationToUsers(ctx context.Context, in *SendPushNotificationToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Unsubscribes a device from push notifications.
|
||||
UnsubscribePushNotifications(ctx context.Context, in *UnsubscribePushNotificationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Gets the WebSocket connection status for a device or user.
|
||||
GetWebsocketConnectionStatus(ctx context.Context, in *GetWebsocketConnectionStatusRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusResponse, error)
|
||||
GetWebsocketConnectionStatusBatch(ctx context.Context, in *GetWebsocketConnectionStatusBatchRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusBatchResponse, error)
|
||||
}
|
||||
|
||||
type ringServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRingServiceClient(cc grpc.ClientConnInterface) RingServiceClient {
|
||||
return &ringServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendEmail(ctx context.Context, in *SendEmailRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacket(ctx context.Context, in *PushWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacket_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToUsers(ctx context.Context, in *PushWebSocketPacketToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToDevice(ctx context.Context, in *PushWebSocketPacketToDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToDevice_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) PushWebSocketPacketToDevices(ctx context.Context, in *PushWebSocketPacketToDevicesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_PushWebSocketPacketToDevices_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendPushNotificationToUser(ctx context.Context, in *SendPushNotificationToUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendPushNotificationToUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) SendPushNotificationToUsers(ctx context.Context, in *SendPushNotificationToUsersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_SendPushNotificationToUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) UnsubscribePushNotifications(ctx context.Context, in *UnsubscribePushNotificationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingService_UnsubscribePushNotifications_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) GetWebsocketConnectionStatus(ctx context.Context, in *GetWebsocketConnectionStatusRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetWebsocketConnectionStatusResponse)
|
||||
err := c.cc.Invoke(ctx, RingService_GetWebsocketConnectionStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ringServiceClient) GetWebsocketConnectionStatusBatch(ctx context.Context, in *GetWebsocketConnectionStatusBatchRequest, opts ...grpc.CallOption) (*GetWebsocketConnectionStatusBatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetWebsocketConnectionStatusBatchResponse)
|
||||
err := c.cc.Invoke(ctx, RingService_GetWebsocketConnectionStatusBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RingServiceServer is the server API for RingService service.
|
||||
// All implementations must embed UnimplementedRingServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// RingService provides methods to send various types of notifications.
|
||||
type RingServiceServer interface {
|
||||
// Sends an email.
|
||||
SendEmail(context.Context, *SendEmailRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a user via WebSocket.
|
||||
PushWebSocketPacket(context.Context, *PushWebSocketPacketRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of users via WebSocket.
|
||||
PushWebSocketPacketToUsers(context.Context, *PushWebSocketPacketToUsersRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a device via WebSocket.
|
||||
PushWebSocketPacketToDevice(context.Context, *PushWebSocketPacketToDeviceRequest) (*emptypb.Empty, error)
|
||||
// Pushes a packet to a list of devices via WebSocket.
|
||||
PushWebSocketPacketToDevices(context.Context, *PushWebSocketPacketToDevicesRequest) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a user.
|
||||
SendPushNotificationToUser(context.Context, *SendPushNotificationToUserRequest) (*emptypb.Empty, error)
|
||||
// Sends a push notification to a list of users.
|
||||
SendPushNotificationToUsers(context.Context, *SendPushNotificationToUsersRequest) (*emptypb.Empty, error)
|
||||
// Unsubscribes a device from push notifications.
|
||||
UnsubscribePushNotifications(context.Context, *UnsubscribePushNotificationsRequest) (*emptypb.Empty, error)
|
||||
// Gets the WebSocket connection status for a device or user.
|
||||
GetWebsocketConnectionStatus(context.Context, *GetWebsocketConnectionStatusRequest) (*GetWebsocketConnectionStatusResponse, error)
|
||||
GetWebsocketConnectionStatusBatch(context.Context, *GetWebsocketConnectionStatusBatchRequest) (*GetWebsocketConnectionStatusBatchResponse, error)
|
||||
mustEmbedUnimplementedRingServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRingServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRingServiceServer struct{}
|
||||
|
||||
func (UnimplementedRingServiceServer) SendEmail(context.Context, *SendEmailRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendEmail not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacket(context.Context, *PushWebSocketPacketRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacket not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToUsers(context.Context, *PushWebSocketPacketToUsersRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToUsers not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToDevice(context.Context, *PushWebSocketPacketToDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToDevice not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) PushWebSocketPacketToDevices(context.Context, *PushWebSocketPacketToDevicesRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PushWebSocketPacketToDevices not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) SendPushNotificationToUser(context.Context, *SendPushNotificationToUserRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendPushNotificationToUser not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) SendPushNotificationToUsers(context.Context, *SendPushNotificationToUsersRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SendPushNotificationToUsers not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) UnsubscribePushNotifications(context.Context, *UnsubscribePushNotificationsRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnsubscribePushNotifications not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) GetWebsocketConnectionStatus(context.Context, *GetWebsocketConnectionStatusRequest) (*GetWebsocketConnectionStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWebsocketConnectionStatus not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) GetWebsocketConnectionStatusBatch(context.Context, *GetWebsocketConnectionStatusBatchRequest) (*GetWebsocketConnectionStatusBatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetWebsocketConnectionStatusBatch not implemented")
|
||||
}
|
||||
func (UnimplementedRingServiceServer) mustEmbedUnimplementedRingServiceServer() {}
|
||||
func (UnimplementedRingServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RingServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRingServiceServer interface {
|
||||
mustEmbedUnimplementedRingServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRingServiceServer(s grpc.ServiceRegistrar, srv RingServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRingServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RingService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RingService_SendEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendEmailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendEmail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendEmail(ctx, req.(*SendEmailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacket(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacket_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacket(ctx, req.(*PushWebSocketPacketRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToUsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToUsers(ctx, req.(*PushWebSocketPacketToUsersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevice(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToDevice_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevice(ctx, req.(*PushWebSocketPacketToDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_PushWebSocketPacketToDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushWebSocketPacketToDevicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevices(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_PushWebSocketPacketToDevices_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).PushWebSocketPacketToDevices(ctx, req.(*PushWebSocketPacketToDevicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_SendPushNotificationToUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendPushNotificationToUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendPushNotificationToUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUser(ctx, req.(*SendPushNotificationToUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_SendPushNotificationToUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendPushNotificationToUsersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_SendPushNotificationToUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).SendPushNotificationToUsers(ctx, req.(*SendPushNotificationToUsersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_UnsubscribePushNotifications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnsubscribePushNotificationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).UnsubscribePushNotifications(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_UnsubscribePushNotifications_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).UnsubscribePushNotifications(ctx, req.(*UnsubscribePushNotificationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_GetWebsocketConnectionStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWebsocketConnectionStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_GetWebsocketConnectionStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatus(ctx, req.(*GetWebsocketConnectionStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RingService_GetWebsocketConnectionStatusBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetWebsocketConnectionStatusBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatusBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingService_GetWebsocketConnectionStatusBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingServiceServer).GetWebsocketConnectionStatusBatch(ctx, req.(*GetWebsocketConnectionStatusBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RingService_ServiceDesc is the grpc.ServiceDesc for RingService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RingService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RingService",
|
||||
HandlerType: (*RingServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "SendEmail",
|
||||
Handler: _RingService_SendEmail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacket",
|
||||
Handler: _RingService_PushWebSocketPacket_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToUsers",
|
||||
Handler: _RingService_PushWebSocketPacketToUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToDevice",
|
||||
Handler: _RingService_PushWebSocketPacketToDevice_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushWebSocketPacketToDevices",
|
||||
Handler: _RingService_PushWebSocketPacketToDevices_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendPushNotificationToUser",
|
||||
Handler: _RingService_SendPushNotificationToUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendPushNotificationToUsers",
|
||||
Handler: _RingService_SendPushNotificationToUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnsubscribePushNotifications",
|
||||
Handler: _RingService_UnsubscribePushNotifications_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWebsocketConnectionStatus",
|
||||
Handler: _RingService_GetWebsocketConnectionStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetWebsocketConnectionStatusBatch",
|
||||
Handler: _RingService_GetWebsocketConnectionStatusBatch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ring.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
RingHandlerService_ReceiveWebSocketPacket_FullMethodName = "/proto.RingHandlerService/ReceiveWebSocketPacket"
|
||||
)
|
||||
|
||||
// RingHandlerServiceClient is the client API for RingHandlerService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RingHandlerServiceClient interface {
|
||||
ReceiveWebSocketPacket(ctx context.Context, in *ReceiveWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type ringHandlerServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRingHandlerServiceClient(cc grpc.ClientConnInterface) RingHandlerServiceClient {
|
||||
return &ringHandlerServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *ringHandlerServiceClient) ReceiveWebSocketPacket(ctx context.Context, in *ReceiveWebSocketPacketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, RingHandlerService_ReceiveWebSocketPacket_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RingHandlerServiceServer is the server API for RingHandlerService service.
|
||||
// All implementations must embed UnimplementedRingHandlerServiceServer
|
||||
// for forward compatibility.
|
||||
type RingHandlerServiceServer interface {
|
||||
ReceiveWebSocketPacket(context.Context, *ReceiveWebSocketPacketRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedRingHandlerServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRingHandlerServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRingHandlerServiceServer struct{}
|
||||
|
||||
func (UnimplementedRingHandlerServiceServer) ReceiveWebSocketPacket(context.Context, *ReceiveWebSocketPacketRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ReceiveWebSocketPacket not implemented")
|
||||
}
|
||||
func (UnimplementedRingHandlerServiceServer) mustEmbedUnimplementedRingHandlerServiceServer() {}
|
||||
func (UnimplementedRingHandlerServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRingHandlerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RingHandlerServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRingHandlerServiceServer interface {
|
||||
mustEmbedUnimplementedRingHandlerServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRingHandlerServiceServer(s grpc.ServiceRegistrar, srv RingHandlerServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRingHandlerServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RingHandlerService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RingHandlerService_ReceiveWebSocketPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReceiveWebSocketPacketRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RingHandlerServiceServer).ReceiveWebSocketPacket(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RingHandlerService_ReceiveWebSocketPacket_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RingHandlerServiceServer).ReceiveWebSocketPacket(ctx, req.(*ReceiveWebSocketPacketRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RingHandlerService_ServiceDesc is the grpc.ServiceDesc for RingHandlerService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RingHandlerService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RingHandlerService",
|
||||
HandlerType: (*RingHandlerServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ReceiveWebSocketPacket",
|
||||
Handler: _RingHandlerService_ReceiveWebSocketPacket_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ring.proto",
|
||||
}
|
||||
297
pkg/shared/proto/wallet.proto
Normal file
297
pkg/shared/proto/wallet.proto
Normal file
@@ -0,0 +1,297 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option csharp_namespace = "DysonNetwork.Shared.Proto";
|
||||
|
||||
option go_package = "git.solsynth.dev/goatworks/turbine/pkg/shared/proto/gen";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
message Wallet {
|
||||
string id = 1;
|
||||
repeated WalletPocket pockets = 2;
|
||||
string account_id = 3;
|
||||
}
|
||||
|
||||
message WalletPocket {
|
||||
string id = 1;
|
||||
string currency = 2;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
string amount = 3;
|
||||
string wallet_id = 4;
|
||||
}
|
||||
|
||||
enum FundSplitType {
|
||||
FUND_SPLIT_TYPE_UNSPECIFIED = 0;
|
||||
FUND_SPLIT_TYPE_EVEN = 1;
|
||||
FUND_SPLIT_TYPE_RANDOM = 2;
|
||||
}
|
||||
|
||||
enum FundStatus {
|
||||
FUND_STATUS_UNSPECIFIED = 0;
|
||||
FUND_STATUS_CREATED = 1;
|
||||
FUND_STATUS_PARTIALLY_RECEIVED = 2;
|
||||
FUND_STATUS_FULLY_RECEIVED = 3;
|
||||
FUND_STATUS_EXPIRED = 4;
|
||||
FUND_STATUS_REFUNDED = 5;
|
||||
}
|
||||
|
||||
message WalletFund {
|
||||
string id = 1;
|
||||
string currency = 2;
|
||||
string total_amount = 3;
|
||||
string remaining_amount = 10;
|
||||
FundSplitType split_type = 4;
|
||||
FundStatus status = 5;
|
||||
google.protobuf.StringValue message = 6;
|
||||
string creator_account_id = 7;
|
||||
google.protobuf.Timestamp expired_at = 8;
|
||||
repeated WalletFundRecipient recipients = 9;
|
||||
}
|
||||
|
||||
message WalletFundRecipient {
|
||||
string id = 1;
|
||||
string fund_id = 2;
|
||||
string recipient_account_id = 3;
|
||||
string amount = 4;
|
||||
bool is_received = 5;
|
||||
optional google.protobuf.Timestamp received_at = 6;
|
||||
}
|
||||
|
||||
enum SubscriptionStatus {
|
||||
// Using proto3 enum naming convention
|
||||
SUBSCRIPTION_STATUS_UNSPECIFIED = 0;
|
||||
SUBSCRIPTION_STATUS_UNPAID = 1;
|
||||
SUBSCRIPTION_STATUS_ACTIVE = 2;
|
||||
SUBSCRIPTION_STATUS_EXPIRED = 3;
|
||||
SUBSCRIPTION_STATUS_CANCELLED = 4;
|
||||
}
|
||||
|
||||
enum GiftStatus {
|
||||
// Using proto3 enum naming convention
|
||||
GIFT_STATUS_UNSPECIFIED = 0;
|
||||
GIFT_STATUS_CREATED = 1;
|
||||
GIFT_STATUS_SENT = 2;
|
||||
GIFT_STATUS_REDEEMED = 3;
|
||||
GIFT_STATUS_EXPIRED = 4;
|
||||
GIFT_STATUS_CANCELLED = 5;
|
||||
}
|
||||
|
||||
message Subscription {
|
||||
string id = 1;
|
||||
google.protobuf.Timestamp begun_at = 2;
|
||||
optional google.protobuf.Timestamp ended_at = 3;
|
||||
string identifier = 4;
|
||||
bool is_active = 5;
|
||||
bool is_free_trial = 6;
|
||||
SubscriptionStatus status = 7;
|
||||
string payment_method = 8;
|
||||
PaymentDetails payment_details = 9;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
string base_price = 10;
|
||||
optional string coupon_id = 11;
|
||||
optional Coupon coupon = 12;
|
||||
optional google.protobuf.Timestamp renewal_at = 13;
|
||||
string account_id = 14;
|
||||
bool is_available = 15;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
string final_price = 16;
|
||||
google.protobuf.Timestamp created_at = 17;
|
||||
google.protobuf.Timestamp updated_at = 18;
|
||||
}
|
||||
|
||||
message SubscriptionReferenceObject {
|
||||
string id = 1;
|
||||
string identifier = 2;
|
||||
google.protobuf.Timestamp begun_at = 3;
|
||||
optional google.protobuf.Timestamp ended_at = 4;
|
||||
bool is_active = 5;
|
||||
bool is_available = 6;
|
||||
bool is_free_trial = 7;
|
||||
SubscriptionStatus status = 8;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
string base_price = 9;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
string final_price = 10;
|
||||
optional google.protobuf.Timestamp renewal_at = 11;
|
||||
string account_id = 12;
|
||||
optional string display_name = 13;
|
||||
google.protobuf.Timestamp created_at = 14;
|
||||
google.protobuf.Timestamp updated_at = 15;
|
||||
}
|
||||
|
||||
message PaymentDetails {
|
||||
string currency = 1;
|
||||
optional string order_id = 2;
|
||||
}
|
||||
|
||||
message Coupon {
|
||||
string id = 1;
|
||||
optional string identifier = 2;
|
||||
optional string code = 3;
|
||||
optional google.protobuf.Timestamp affected_at = 4;
|
||||
optional google.protobuf.Timestamp expired_at = 5;
|
||||
// Using string for decimal to avoid precision loss.
|
||||
optional string discount_amount = 6;
|
||||
optional google.protobuf.DoubleValue discount_rate = 7;
|
||||
optional google.protobuf.Int32Value max_usage = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
|
||||
message Gift {
|
||||
string id = 1;
|
||||
string gifter_id = 2;
|
||||
optional string recipient_id = 3;
|
||||
string gift_code = 4;
|
||||
optional string message = 5;
|
||||
string subscription_identifier = 6;
|
||||
string base_price = 7;
|
||||
string final_price = 8;
|
||||
GiftStatus status = 9;
|
||||
optional google.protobuf.Timestamp redeemed_at = 10;
|
||||
optional string redeemer_id = 11;
|
||||
optional string subscription_id = 12;
|
||||
google.protobuf.Timestamp expires_at = 13;
|
||||
bool is_open_gift = 14;
|
||||
string payment_method = 15;
|
||||
PaymentDetails payment_details = 16;
|
||||
optional string coupon_id = 17;
|
||||
optional Coupon coupon = 18;
|
||||
bool is_redeemable = 19;
|
||||
bool is_expired = 20;
|
||||
google.protobuf.Timestamp created_at = 21;
|
||||
google.protobuf.Timestamp updated_at = 22;
|
||||
}
|
||||
|
||||
service WalletService {
|
||||
rpc GetWallet(GetWalletRequest) returns (Wallet);
|
||||
rpc CreateWallet(CreateWalletRequest) returns (Wallet);
|
||||
rpc GetOrCreateWalletPocket(GetOrCreateWalletPocketRequest) returns (WalletPocket);
|
||||
}
|
||||
|
||||
message GetWalletRequest {
|
||||
string account_id = 1;
|
||||
}
|
||||
|
||||
message CreateWalletRequest {
|
||||
string account_id = 1;
|
||||
}
|
||||
|
||||
message GetOrCreateWalletPocketRequest {
|
||||
string wallet_id = 1;
|
||||
string currency = 2;
|
||||
optional string initial_amount = 3;
|
||||
}
|
||||
|
||||
service PaymentService {
|
||||
rpc CreateOrder(CreateOrderRequest) returns (Order);
|
||||
rpc CreateTransactionWithAccount(CreateTransactionWithAccountRequest) returns (Transaction);
|
||||
rpc CreateTransaction(CreateTransactionRequest) returns (Transaction);
|
||||
rpc CancelOrder(CancelOrderRequest) returns (Order);
|
||||
rpc RefundOrder(RefundOrderRequest) returns (RefundOrderResponse);
|
||||
rpc Transfer(TransferRequest) returns (Transaction);
|
||||
rpc GetWalletFund(GetWalletFundRequest) returns (WalletFund);
|
||||
}
|
||||
|
||||
message CreateOrderRequest {
|
||||
optional string payee_wallet_id = 1;
|
||||
string currency = 2;
|
||||
string amount = 3;
|
||||
optional google.protobuf.Duration expiration = 4;
|
||||
optional string app_identifier = 5;
|
||||
optional string product_identifier = 8;
|
||||
// Using bytes for meta to represent JSON.
|
||||
optional bytes meta = 6;
|
||||
optional string remarks = 9;
|
||||
bool reuseable = 7;
|
||||
}
|
||||
|
||||
message Order {
|
||||
string id = 1;
|
||||
google.protobuf.StringValue payee_wallet_id = 2;
|
||||
google.protobuf.StringValue currency = 3;
|
||||
string amount = 4;
|
||||
google.protobuf.Timestamp expired_at = 5;
|
||||
google.protobuf.StringValue app_identifier = 6;
|
||||
google.protobuf.StringValue product_identifier = 12;
|
||||
// Using bytes for meta to represent JSON.
|
||||
optional bytes meta = 7;
|
||||
OrderStatus status = 8;
|
||||
google.protobuf.StringValue transaction_id = 9;
|
||||
optional Transaction transaction = 10;
|
||||
google.protobuf.StringValue remarks = 11;
|
||||
}
|
||||
|
||||
enum OrderStatus {
|
||||
ORDER_STATUS_UNSPECIFIED = 0;
|
||||
ORDER_STATUS_UNPAID = 1;
|
||||
ORDER_STATUS_PAID = 2;
|
||||
ORDER_STATUS_EXPIRED = 3;
|
||||
ORDER_STATUS_CANCELLED = 4;
|
||||
ORDER_STATUS_FINISHED = 5;
|
||||
}
|
||||
|
||||
message Transaction {
|
||||
string id = 1;
|
||||
google.protobuf.StringValue payer_wallet_id = 2;
|
||||
google.protobuf.StringValue payee_wallet_id = 3;
|
||||
string currency = 4;
|
||||
string amount = 5;
|
||||
google.protobuf.StringValue remarks = 6;
|
||||
TransactionType type = 7;
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
google.protobuf.Timestamp updated_at = 9;
|
||||
}
|
||||
|
||||
enum TransactionType {
|
||||
TRANSACTION_TYPE_UNSPECIFIED = 0;
|
||||
TRANSACTION_TYPE_SYSTEM = 1;
|
||||
TRANSACTION_TYPE_ORDER = 2;
|
||||
TRANSACTION_TYPE_TRANSFER = 3;
|
||||
}
|
||||
|
||||
message CreateTransactionWithAccountRequest {
|
||||
google.protobuf.StringValue payer_account_id = 1;
|
||||
google.protobuf.StringValue payee_account_id = 2;
|
||||
string currency = 3;
|
||||
string amount = 4;
|
||||
google.protobuf.StringValue remarks = 5;
|
||||
TransactionType type = 6;
|
||||
}
|
||||
|
||||
message CreateTransactionRequest {
|
||||
google.protobuf.StringValue payer_wallet_id = 1;
|
||||
google.protobuf.StringValue payee_wallet_id = 2;
|
||||
string currency = 3;
|
||||
string amount = 4;
|
||||
google.protobuf.StringValue remarks = 5;
|
||||
TransactionType type = 6;
|
||||
}
|
||||
|
||||
message CancelOrderRequest {
|
||||
string order_id = 1;
|
||||
}
|
||||
|
||||
message RefundOrderRequest {
|
||||
string order_id = 1;
|
||||
}
|
||||
|
||||
message RefundOrderResponse {
|
||||
Order order = 1;
|
||||
Transaction refund_transaction = 2;
|
||||
}
|
||||
|
||||
message TransferRequest {
|
||||
string payer_account_id = 1;
|
||||
string payee_account_id = 2;
|
||||
string currency = 3;
|
||||
string amount = 4;
|
||||
}
|
||||
|
||||
message GetWalletFundRequest {
|
||||
string fund_id = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user