diff options
| author | garder500 <jeremy27.clara22@gmail.com> | 2025-10-26 15:29:23 +0100 |
|---|---|---|
| committer | garder500 <jeremy27.clara22@gmail.com> | 2025-10-26 15:29:23 +0100 |
| commit | fc485c8de10e6dea63054278c8d30d24d87fd621 (patch) | |
| tree | c314a952e53a819dc62a796b63e8b76cc5ee8ba4 | |
| parent | 2f3ab35c11a82a77aee77f91a83ddf9a5b6aea12 (diff) | |
feat: add gRPC services for User, Project, and Organization management
- Implemented UserService with methods for GetUser, CreateUser, UpdateUser, and DeleteUser.
- Implemented ProjectService with methods for GetProject, CreateProject, UpdateProject, and DeleteProject.
- Implemented OrganizationService with methods for GetOrganization, CreateOrganization, UpdateOrganization, and DeleteOrganization.
- Defined corresponding request and response message types for each service.
- Generated gRPC code from proto definitions for seamless integration.
| -rw-r--r-- | Makefile | 20 | ||||
| -rw-r--r-- | config.toml | 22 | ||||
| -rw-r--r-- | devenv.nix | 2 | ||||
| -rw-r--r-- | docs/config.md | 166 | ||||
| -rw-r--r-- | go.mod | 11 | ||||
| -rw-r--r-- | go.sum | 14 | ||||
| -rw-r--r-- | internal/config/config.go | 62 | ||||
| -rw-r--r-- | pkg/proto/sovrabase.pb.go | 1381 | ||||
| -rw-r--r-- | pkg/proto/sovrabase_grpc.pb.go | 679 | ||||
| -rw-r--r-- | proto/sovrabase.proto | 146 |
10 files changed, 2502 insertions, 1 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e558582 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.PHONY: build run test clean proto + +build: + go build -o bin/server ./cmd/server + +run: + go run ./cmd/server + +test: + go test ./... + +proto: + protoc \ + --go_out=pkg --go_opt=paths=source_relative \ + --go-grpc_out=pkg --go-grpc_opt=paths=source_relative \ + proto/*.proto + + +clean: + rm -rf bin/ diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..fae791d --- /dev/null +++ b/config.toml @@ -0,0 +1,22 @@ +region = "supabase" + +[rpc] +rpc_secret = "random_secret_12345" +rpc_addr = "[::]:8080" + +[api] +api_addr = "[::]:3000" +api_domain = "example.com" + +[internal_db] +manager = "sqlite" +uri = "./database/internal.db" + +[external_db] +manager = "postgres" +uri = "postgres://root:password@localhost:5432/" + +[cluster] +node_id = "node-01" +is_rpc_server = true +rpc_servers = ["[::]:8080"] @@ -5,7 +5,7 @@ env.GREET = "devenv"; # https://devenv.sh/packages/ - packages = [ pkgs.git ]; + packages = [ pkgs.git pkgs.protobuf pkgs.protoc-gen-go pkgs.protoc-gen-go-grpc ]; # https://devenv.sh/languages/ languages.go.enable = true; diff --git a/docs/config.md b/docs/config.md new file mode 100644 index 0000000..f3236f3 --- /dev/null +++ b/docs/config.md @@ -0,0 +1,166 @@ +# Configuration + +Ce document décrit le format du fichier de configuration pour Sovrabase. La configuration est stockée dans un fichier TOML (généralement `config.toml`) et contient tous les paramètres nécessaires au fonctionnement de l'application. + +## Emplacement du fichier + +Le fichier de configuration doit être placé dans le répertoire racine du projet et nommé `config.toml`. + +## Structure de la configuration + +La configuration est organisée en plusieurs sections pour une meilleure organisation et lisibilité. + +### Niveau racine + +| Champ | Type | Défaut | Description | +|-------|------|---------|-------------| +| `region` | string | "supabase" | L'identifiant de région pour l'application | + +### Section [rpc] + +Configuration pour le service RPC (Remote Procedure Call). + +| Champ | Type | Description | +|-------|------|-------------| +| `rpc_secret` | string | Clé secrète utilisée pour l'authentification RPC. **Doit être identique sur tous les nœuds du cluster** pour permettre la communication inter-nœuds. | +| `rpc_addr` | string | Adresse réseau et port pour le serveur RPC (ex: "[::]:8080") | + +### Section [api] + +Configuration pour le service API principal. + +| Champ | Type | Description | +|-------|------|-------------| +| `api_addr` | string | Adresse réseau et port pour le serveur API (ex: "0.0.0.0:3000") | +| `api_domain` | string | Nom de domaine pour l'API (ex: "example.com") | + +### Section [internal_db] + +Configuration pour la base de données interne utilisée par l'application. + +| Champ | Type | Description | +|-------|------|-------------| +| `manager` | string | Type de base de données. Valeurs supportées : "postgres", "mysql", "sqlite" | +| `uri` | string | URI de connexion à la base de données. Pour SQLite, utiliser un chemin de fichier (ex: "./database/internal.db") | + +### Section [external_db] + +Configuration pour les bases de données externes auxquelles l'application peut se connecter. + +| Champ | Type | Description | +|-------|------|-------------| +| `manager` | string | Type de base de données. Valeurs supportées : "postgres", "mysql" | +| `uri` | string | URI de connexion à la base de données pour l'utilisateur root. Doit pointer vers l'adresse du serveur de base de données sans spécifier de base de données particulière (ex: "postgres://root:password@localhost:5432/") | + +### Section [s3_api] + +Configuration pour le service API compatible S3. + +| Champ | Type | Description | +|-------|------|-------------| +| `s3_region` | string | Identifiant de région S3 (ex: "garage") | +| `api_bind_addr` | string | Adresse réseau et port pour le serveur API S3 (ex: "[::]:3900") | +| `root_domain` | string | Domaine racine pour les buckets S3 (ex: ".s3.garage") | + +### Section [cluster] + +Configuration pour le système distribué et multi-nœuds (prise en charge de l'architecture multi-région). + +| Champ | Type | Description | +|-------|------|-------------| +| `node_id` | string | Identifiant unique du nœud dans le cluster | +| `is_rpc_server` | bool | Indique si ce nœud agit comme serveur RPC pour les autres nœuds | +| `rpc_servers` | []string | Liste des **adresses réseau** (IP:port ou hostname:port) des serveurs RPC dans le cluster pour la découverte et connexion | + +**⚠️ Important** : La clé `rpc_secret` (section [rpc]) doit être **identique sur tous les nœuds** du cluster pour permettre l'authentification mutuelle entre nœuds. + +## Exemple de configuration + +```toml +region = "supabase" + +[rpc] +rpc_secret = "random_secret_12345" +rpc_addr = "0.0.0.0:8080" + +[api] +api_addr = "0.0.0.0:3000" +api_domain = "example.com" + +[internal_db] +manager = "sqlite" +uri = "./database/internal.db" + +[external_db] +manager = "postgres" +uri = "postgres://root:password@localhost:5432/" + +[s3_api] +s3_region = "garage" +api_bind_addr = "[::]:3900" +root_domain = ".s3.garage" + +[cluster] +node_id = "node-01" +is_rpc_server = true +rpc_servers = ["192.168.1.10:8080"] +``` + +## Chargement de la configuration + +La configuration est chargée en utilisant la fonction `config.LoadConfig()` : + +```go +cfg, err := config.LoadConfig("config.toml") +if err != nil { + log.Fatal("Échec du chargement de la configuration:", err) +} + +// Accès aux valeurs de configuration +fmt.Println("Adresse RPC:", cfg.RPC.RPCAddr) +fmt.Println("Domaine API:", cfg.API.APIDomain) +fmt.Println("BD interne:", cfg.InternalDB.Manager) +fmt.Println("ID du nœud:", cfg.Cluster.NodeID) +fmt.Println("Serveur RPC:", cfg.Cluster.IsRPCServer) +``` + +## Bonnes pratiques de déploiement cluster + +### Configuration RPC dans un cluster + +Pour un déploiement multi-nœuds, assurez-vous que : + +- **Clé RPC commune** : Tous les nœuds utilisent la **même valeur** pour `rpc_secret` +- **Serveurs RPC désignés** : Au moins un nœud par région doit avoir `is_rpc_server = true` +- **Liste de découverte** : Tous les nœuds doivent lister les **adresses réseau réelles** (IP:port) des serveurs RPC dans `rpc_servers` +- **IDs uniques** : Chaque nœud doit avoir un `node_id` unique dans le cluster + +**Comprendre `rpc_servers`** : Cette liste contient les adresses réseau des nœuds qui agissent comme serveurs RPC. Les clients RPC utilisent cette liste pour découvrir et se connecter aux serveurs disponibles dans le cluster. + +**Exemple de configuration cluster** : +```toml +# Nœud 1 (serveur RPC) - Région Europe +[cluster] +node_id = "node-01" +is_rpc_server = true +rpc_servers = ["192.168.1.10:8080"] # Son propre adresse RPC + +# Nœud 2 (client RPC) - Région Europe +[cluster] +node_id = "node-02" +is_rpc_server = false +rpc_servers = ["192.168.1.10:8080", "192.168.1.11:8080"] # Liste des serveurs RPC disponibles + +# Nœud 3 (serveur RPC) - Région Asie +[cluster] +node_id = "node-03" +is_rpc_server = true +rpc_servers = ["192.168.2.10:8080"] # Son propre adresse RPC +``` + +## Notes de sécurité + +- Stockez le fichier de configuration de manière sécurisée et évitez de commiter les secrets dans le contrôle de version +- Utilisez des valeurs fortes et générées aléatoirement pour `rpc_secret` +- Assurez-vous que les credentials de base de données dans les URI ont les permissions appropriées (accès root pour external_db) +- Envisagez d'utiliser des variables d'environnement ou des systèmes de gestion des secrets pour les valeurs sensibles en production @@ -1,3 +1,14 @@ module github.com/ketsuna-org/sovrabase go 1.25.2 + +require github.com/BurntSushi/toml v1.5.0 + +require ( + golang.org/x/net v0.42.0 // indirect + golang.org/x/sys v0.34.0 // indirect + golang.org/x/text v0.27.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect + google.golang.org/grpc v1.76.0 // indirect + google.golang.org/protobuf v1.36.10 // indirect +) @@ -0,0 +1,14 @@ +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= +golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b h1:zPKJod4w6F1+nRGDI9ubnXYhU9NSWoFAijkHkUXeTK8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A= +google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/internal/config/config.go b/internal/config/config.go index d912156..c872203 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1 +1,63 @@ package config + +import ( + "fmt" + + "github.com/BurntSushi/toml" +) + +// RPC holds RPC configuration +type RPC struct { + RPCSecret string + RPCAddr string +} + +// API holds API configuration +type API struct { + APIAddr string + APIDomain string +} + +// InternalDB holds internal database configuration +type InternalDB struct { + Manager string + URI string +} + +// ExternalDB holds external database configuration +type ExternalDB struct { + Manager string + URI string +} + +// Cluster holds cluster/distributed configuration +type Cluster struct { + NodeID string + IsRPCServer bool + RPCServers []string +} + +// Config holds the application configuration +type Config struct { + Region string + RPC RPC + API API + InternalDB InternalDB + ExternalDB ExternalDB + Cluster Cluster +} + +// LoadConfig loads configuration from a TOML file +func LoadConfig(filePath string) (*Config, error) { + var config Config + if _, err := toml.DecodeFile(filePath, &config); err != nil { + return nil, fmt.Errorf("failed to decode config file: %w", err) + } + + // Set defaults + if config.Region == "" { + config.Region = "supabase" + } + + return &config, nil +} diff --git a/pkg/proto/sovrabase.pb.go b/pkg/proto/sovrabase.pb.go new file mode 100644 index 0000000..9251114 --- /dev/null +++ b/pkg/proto/sovrabase.pb.go @@ -0,0 +1,1381 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.1 +// source: proto/sovrabase.proto + +package sovrabase + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +type GetUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{0} +} + +func (x *GetUserRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserResponse) Reset() { + *x = GetUserResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserResponse) ProtoMessage() {} + +func (x *GetUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 GetUserResponse.ProtoReflect.Descriptor instead. +func (*GetUserResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{1} +} + +func (x *GetUserResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetUserResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetUserResponse) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type CreateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateUserRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type CreateUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserResponse) Reset() { + *x = CreateUserResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserResponse) ProtoMessage() {} + +func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 CreateUserResponse.ProtoReflect.Descriptor instead. +func (*CreateUserResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateUserResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type UpdateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateUserRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateUserRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type UpdateUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserResponse) Reset() { + *x = UpdateUserResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserResponse) ProtoMessage() {} + +func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_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 UpdateUserResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type DeleteUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[6] + 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 DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteUserRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserResponse) Reset() { + *x = DeleteUserResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserResponse) ProtoMessage() {} + +func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[7] + 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 DeleteUserResponse.ProtoReflect.Descriptor instead. +func (*DeleteUserResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type GetProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectRequest) Reset() { + *x = GetProjectRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectRequest) ProtoMessage() {} + +func (x *GetProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[8] + 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 GetProjectRequest.ProtoReflect.Descriptor instead. +func (*GetProjectRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{8} +} + +func (x *GetProjectRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectResponse) Reset() { + *x = GetProjectResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectResponse) ProtoMessage() {} + +func (x *GetProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[9] + 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 GetProjectResponse.ProtoReflect.Descriptor instead. +func (*GetProjectResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{9} +} + +func (x *GetProjectResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetProjectResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetProjectResponse) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type CreateProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectRequest) Reset() { + *x = CreateProjectRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectRequest) ProtoMessage() {} + +func (x *CreateProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[10] + 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 CreateProjectRequest.ProtoReflect.Descriptor instead. +func (*CreateProjectRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{10} +} + +func (x *CreateProjectRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateProjectRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type CreateProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectResponse) Reset() { + *x = CreateProjectResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectResponse) ProtoMessage() {} + +func (x *CreateProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[11] + 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 CreateProjectResponse.ProtoReflect.Descriptor instead. +func (*CreateProjectResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{11} +} + +func (x *CreateProjectResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type UpdateProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateProjectRequest) Reset() { + *x = UpdateProjectRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateProjectRequest) ProtoMessage() {} + +func (x *UpdateProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[12] + 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 UpdateProjectRequest.ProtoReflect.Descriptor instead. +func (*UpdateProjectRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{12} +} + +func (x *UpdateProjectRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateProjectRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateProjectRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type UpdateProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateProjectResponse) Reset() { + *x = UpdateProjectResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateProjectResponse) ProtoMessage() {} + +func (x *UpdateProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[13] + 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 UpdateProjectResponse.ProtoReflect.Descriptor instead. +func (*UpdateProjectResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateProjectResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type DeleteProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProjectRequest) Reset() { + *x = DeleteProjectRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProjectRequest) ProtoMessage() {} + +func (x *DeleteProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[14] + 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 DeleteProjectRequest.ProtoReflect.Descriptor instead. +func (*DeleteProjectRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{14} +} + +func (x *DeleteProjectRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProjectResponse) Reset() { + *x = DeleteProjectResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProjectResponse) ProtoMessage() {} + +func (x *DeleteProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[15] + 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 DeleteProjectResponse.ProtoReflect.Descriptor instead. +func (*DeleteProjectResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{15} +} + +func (x *DeleteProjectResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type GetOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrganizationRequest) Reset() { + *x = GetOrganizationRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrganizationRequest) ProtoMessage() {} + +func (x *GetOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[16] + 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 GetOrganizationRequest.ProtoReflect.Descriptor instead. +func (*GetOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{16} +} + +func (x *GetOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrganizationResponse) Reset() { + *x = GetOrganizationResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrganizationResponse) ProtoMessage() {} + +func (x *GetOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[17] + 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 GetOrganizationResponse.ProtoReflect.Descriptor instead. +func (*GetOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{17} +} + +func (x *GetOrganizationResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetOrganizationResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetOrganizationResponse) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type CreateOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrganizationRequest) Reset() { + *x = CreateOrganizationRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrganizationRequest) ProtoMessage() {} + +func (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[18] + 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 CreateOrganizationRequest.ProtoReflect.Descriptor instead. +func (*CreateOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{18} +} + +func (x *CreateOrganizationRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateOrganizationRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type CreateOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrganizationResponse) Reset() { + *x = CreateOrganizationResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrganizationResponse) ProtoMessage() {} + +func (x *CreateOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[19] + 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 CreateOrganizationResponse.ProtoReflect.Descriptor instead. +func (*CreateOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{19} +} + +func (x *CreateOrganizationResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type UpdateOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateOrganizationRequest) Reset() { + *x = UpdateOrganizationRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOrganizationRequest) ProtoMessage() {} + +func (x *UpdateOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[20] + 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 UpdateOrganizationRequest.ProtoReflect.Descriptor instead. +func (*UpdateOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{20} +} + +func (x *UpdateOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateOrganizationRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateOrganizationRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type UpdateOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateOrganizationResponse) Reset() { + *x = UpdateOrganizationResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateOrganizationResponse) ProtoMessage() {} + +func (x *UpdateOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[21] + 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 UpdateOrganizationResponse.ProtoReflect.Descriptor instead. +func (*UpdateOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{21} +} + +func (x *UpdateOrganizationResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type DeleteOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteOrganizationRequest) Reset() { + *x = DeleteOrganizationRequest{} + mi := &file_proto_sovrabase_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOrganizationRequest) ProtoMessage() {} + +func (x *DeleteOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[22] + 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 DeleteOrganizationRequest.ProtoReflect.Descriptor instead. +func (*DeleteOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{22} +} + +func (x *DeleteOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteOrganizationResponse) Reset() { + *x = DeleteOrganizationResponse{} + mi := &file_proto_sovrabase_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOrganizationResponse) ProtoMessage() {} + +func (x *DeleteOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_sovrabase_proto_msgTypes[23] + 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 DeleteOrganizationResponse.ProtoReflect.Descriptor instead. +func (*DeleteOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_sovrabase_proto_rawDescGZIP(), []int{23} +} + +func (x *DeleteOrganizationResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +var File_proto_sovrabase_proto protoreflect.FileDescriptor + +const file_proto_sovrabase_proto_rawDesc = "" + + "\n" + + "\x15proto/sovrabase.proto\x12\tsovrabase\" \n" + + "\x0eGetUserRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"K\n" + + "\x0fGetUserResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\"=\n" + + "\x11CreateUserRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05email\x18\x02 \x01(\tR\x05email\"$\n" + + "\x12CreateUserResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"M\n" + + "\x11UpdateUserRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\".\n" + + "\x12UpdateUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"#\n" + + "\x11DeleteUserRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\".\n" + + "\x12DeleteUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"#\n" + + "\x11GetProjectRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"Z\n" + + "\x12GetProjectResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\"L\n" + + "\x14CreateProjectRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\"'\n" + + "\x15CreateProjectResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\\\n" + + "\x14UpdateProjectRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\"1\n" + + "\x15UpdateProjectResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"&\n" + + "\x14DeleteProjectRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"1\n" + + "\x15DeleteProjectResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"(\n" + + "\x16GetOrganizationRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"_\n" + + "\x17GetOrganizationResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\"Q\n" + + "\x19CreateOrganizationRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\",\n" + + "\x1aCreateOrganizationResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"a\n" + + "\x19UpdateOrganizationRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\"6\n" + + "\x1aUpdateOrganizationResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\"+\n" + + "\x19DeleteOrganizationRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"6\n" + + "\x1aDeleteOrganizationResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess2\xb0\x02\n" + + "\vUserService\x12@\n" + + "\aGetUser\x12\x19.sovrabase.GetUserRequest\x1a\x1a.sovrabase.GetUserResponse\x12I\n" + + "\n" + + "CreateUser\x12\x1c.sovrabase.CreateUserRequest\x1a\x1d.sovrabase.CreateUserResponse\x12I\n" + + "\n" + + "UpdateUser\x12\x1c.sovrabase.UpdateUserRequest\x1a\x1d.sovrabase.UpdateUserResponse\x12I\n" + + "\n" + + "DeleteUser\x12\x1c.sovrabase.DeleteUserRequest\x1a\x1d.sovrabase.DeleteUserResponse2\xd7\x02\n" + + "\x0eProjectService\x12I\n" + + "\n" + + "GetProject\x12\x1c.sovrabase.GetProjectRequest\x1a\x1d.sovrabase.GetProjectResponse\x12R\n" + + "\rCreateProject\x12\x1f.sovrabase.CreateProjectRequest\x1a .sovrabase.CreateProjectResponse\x12R\n" + + "\rUpdateProject\x12\x1f.sovrabase.UpdateProjectRequest\x1a .sovrabase.UpdateProjectResponse\x12R\n" + + "\rDeleteProject\x12\x1f.sovrabase.DeleteProjectRequest\x1a .sovrabase.DeleteProjectResponse2\x98\x03\n" + + "\x13OrganizationService\x12X\n" + + "\x0fGetOrganization\x12!.sovrabase.GetOrganizationRequest\x1a\".sovrabase.GetOrganizationResponse\x12a\n" + + "\x12CreateOrganization\x12$.sovrabase.CreateOrganizationRequest\x1a%.sovrabase.CreateOrganizationResponse\x12a\n" + + "\x12UpdateOrganization\x12$.sovrabase.UpdateOrganizationRequest\x1a%.sovrabase.UpdateOrganizationResponse\x12a\n" + + "\x12DeleteOrganization\x12$.sovrabase.DeleteOrganizationRequest\x1a%.sovrabase.DeleteOrganizationResponseB\"Z github.com/ketsuna-org/sovrabaseb\x06proto3" + +var ( + file_proto_sovrabase_proto_rawDescOnce sync.Once + file_proto_sovrabase_proto_rawDescData []byte +) + +func file_proto_sovrabase_proto_rawDescGZIP() []byte { + file_proto_sovrabase_proto_rawDescOnce.Do(func() { + file_proto_sovrabase_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_sovrabase_proto_rawDesc), len(file_proto_sovrabase_proto_rawDesc))) + }) + return file_proto_sovrabase_proto_rawDescData +} + +var file_proto_sovrabase_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_proto_sovrabase_proto_goTypes = []any{ + (*GetUserRequest)(nil), // 0: sovrabase.GetUserRequest + (*GetUserResponse)(nil), // 1: sovrabase.GetUserResponse + (*CreateUserRequest)(nil), // 2: sovrabase.CreateUserRequest + (*CreateUserResponse)(nil), // 3: sovrabase.CreateUserResponse + (*UpdateUserRequest)(nil), // 4: sovrabase.UpdateUserRequest + (*UpdateUserResponse)(nil), // 5: sovrabase.UpdateUserResponse + (*DeleteUserRequest)(nil), // 6: sovrabase.DeleteUserRequest + (*DeleteUserResponse)(nil), // 7: sovrabase.DeleteUserResponse + (*GetProjectRequest)(nil), // 8: sovrabase.GetProjectRequest + (*GetProjectResponse)(nil), // 9: sovrabase.GetProjectResponse + (*CreateProjectRequest)(nil), // 10: sovrabase.CreateProjectRequest + (*CreateProjectResponse)(nil), // 11: sovrabase.CreateProjectResponse + (*UpdateProjectRequest)(nil), // 12: sovrabase.UpdateProjectRequest + (*UpdateProjectResponse)(nil), // 13: sovrabase.UpdateProjectResponse + (*DeleteProjectRequest)(nil), // 14: sovrabase.DeleteProjectRequest + (*DeleteProjectResponse)(nil), // 15: sovrabase.DeleteProjectResponse + (*GetOrganizationRequest)(nil), // 16: sovrabase.GetOrganizationRequest + (*GetOrganizationResponse)(nil), // 17: sovrabase.GetOrganizationResponse + (*CreateOrganizationRequest)(nil), // 18: sovrabase.CreateOrganizationRequest + (*CreateOrganizationResponse)(nil), // 19: sovrabase.CreateOrganizationResponse + (*UpdateOrganizationRequest)(nil), // 20: sovrabase.UpdateOrganizationRequest + (*UpdateOrganizationResponse)(nil), // 21: sovrabase.UpdateOrganizationResponse + (*DeleteOrganizationRequest)(nil), // 22: sovrabase.DeleteOrganizationRequest + (*DeleteOrganizationResponse)(nil), // 23: sovrabase.DeleteOrganizationResponse +} +var file_proto_sovrabase_proto_depIdxs = []int32{ + 0, // 0: sovrabase.UserService.GetUser:input_type -> sovrabase.GetUserRequest + 2, // 1: sovrabase.UserService.CreateUser:input_type -> sovrabase.CreateUserRequest + 4, // 2: sovrabase.UserService.UpdateUser:input_type -> sovrabase.UpdateUserRequest + 6, // 3: sovrabase.UserService.DeleteUser:input_type -> sovrabase.DeleteUserRequest + 8, // 4: sovrabase.ProjectService.GetProject:input_type -> sovrabase.GetProjectRequest + 10, // 5: sovrabase.ProjectService.CreateProject:input_type -> sovrabase.CreateProjectRequest + 12, // 6: sovrabase.ProjectService.UpdateProject:input_type -> sovrabase.UpdateProjectRequest + 14, // 7: sovrabase.ProjectService.DeleteProject:input_type -> sovrabase.DeleteProjectRequest + 16, // 8: sovrabase.OrganizationService.GetOrganization:input_type -> sovrabase.GetOrganizationRequest + 18, // 9: sovrabase.OrganizationService.CreateOrganization:input_type -> sovrabase.CreateOrganizationRequest + 20, // 10: sovrabase.OrganizationService.UpdateOrganization:input_type -> sovrabase.UpdateOrganizationRequest + 22, // 11: sovrabase.OrganizationService.DeleteOrganization:input_type -> sovrabase.DeleteOrganizationRequest + 1, // 12: sovrabase.UserService.GetUser:output_type -> sovrabase.GetUserResponse + 3, // 13: sovrabase.UserService.CreateUser:output_type -> sovrabase.CreateUserResponse + 5, // 14: sovrabase.UserService.UpdateUser:output_type -> sovrabase.UpdateUserResponse + 7, // 15: sovrabase.UserService.DeleteUser:output_type -> sovrabase.DeleteUserResponse + 9, // 16: sovrabase.ProjectService.GetProject:output_type -> sovrabase.GetProjectResponse + 11, // 17: sovrabase.ProjectService.CreateProject:output_type -> sovrabase.CreateProjectResponse + 13, // 18: sovrabase.ProjectService.UpdateProject:output_type -> sovrabase.UpdateProjectResponse + 15, // 19: sovrabase.ProjectService.DeleteProject:output_type -> sovrabase.DeleteProjectResponse + 17, // 20: sovrabase.OrganizationService.GetOrganization:output_type -> sovrabase.GetOrganizationResponse + 19, // 21: sovrabase.OrganizationService.CreateOrganization:output_type -> sovrabase.CreateOrganizationResponse + 21, // 22: sovrabase.OrganizationService.UpdateOrganization:output_type -> sovrabase.UpdateOrganizationResponse + 23, // 23: sovrabase.OrganizationService.DeleteOrganization:output_type -> sovrabase.DeleteOrganizationResponse + 12, // [12:24] is the sub-list for method output_type + 0, // [0:12] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_sovrabase_proto_init() } +func file_proto_sovrabase_proto_init() { + if File_proto_sovrabase_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_sovrabase_proto_rawDesc), len(file_proto_sovrabase_proto_rawDesc)), + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 3, + }, + GoTypes: file_proto_sovrabase_proto_goTypes, + DependencyIndexes: file_proto_sovrabase_proto_depIdxs, + MessageInfos: file_proto_sovrabase_proto_msgTypes, + }.Build() + File_proto_sovrabase_proto = out.File + file_proto_sovrabase_proto_goTypes = nil + file_proto_sovrabase_proto_depIdxs = nil +} diff --git a/pkg/proto/sovrabase_grpc.pb.go b/pkg/proto/sovrabase_grpc.pb.go new file mode 100644 index 0000000..929de54 --- /dev/null +++ b/pkg/proto/sovrabase_grpc.pb.go @@ -0,0 +1,679 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.32.1 +// source: proto/sovrabase.proto + +package sovrabase + +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 ( + UserService_GetUser_FullMethodName = "/sovrabase.UserService/GetUser" + UserService_CreateUser_FullMethodName = "/sovrabase.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/sovrabase.UserService/UpdateUser" + UserService_DeleteUser_FullMethodName = "/sovrabase.UserService/DeleteUser" +) + +// UserServiceClient is the client API for UserService 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. +// +// User service +type UserServiceClient interface { + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetUserResponse) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateUserResponse) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateUserResponse) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteUserResponse) + err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility. +// +// User service +type UserServiceServer interface { + GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) + CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) + UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) + DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer 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 UnimplementedUserServiceServer struct{} + +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} +func (UnimplementedUserServiceServer) testEmbeddedByValue() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + // If the following call pancis, it indicates UnimplementedUserServiceServer 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(&UserService_ServiceDesc, srv) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sovrabase.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "CreateUser", + Handler: _UserService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _UserService_DeleteUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/sovrabase.proto", +} + +const ( + ProjectService_GetProject_FullMethodName = "/sovrabase.ProjectService/GetProject" + ProjectService_CreateProject_FullMethodName = "/sovrabase.ProjectService/CreateProject" + ProjectService_UpdateProject_FullMethodName = "/sovrabase.ProjectService/UpdateProject" + ProjectService_DeleteProject_FullMethodName = "/sovrabase.ProjectService/DeleteProject" +) + +// ProjectServiceClient is the client API for ProjectService 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. +// +// Project service +type ProjectServiceClient interface { + GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*GetProjectResponse, error) + CreateProject(ctx context.Context, in *CreateProjectRequest, opts ...grpc.CallOption) (*CreateProjectResponse, error) + UpdateProject(ctx context.Context, in *UpdateProjectRequest, opts ...grpc.CallOption) (*UpdateProjectResponse, error) + DeleteProject(ctx context.Context, in *DeleteProjectRequest, opts ...grpc.CallOption) (*DeleteProjectResponse, error) +} + +type projectServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewProjectServiceClient(cc grpc.ClientConnInterface) ProjectServiceClient { + return &projectServiceClient{cc} +} + +func (c *projectServiceClient) GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*GetProjectResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetProjectResponse) + err := c.cc.Invoke(ctx, ProjectService_GetProject_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectServiceClient) CreateProject(ctx context.Context, in *CreateProjectRequest, opts ...grpc.CallOption) (*CreateProjectResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateProjectResponse) + err := c.cc.Invoke(ctx, ProjectService_CreateProject_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectServiceClient) UpdateProject(ctx context.Context, in *UpdateProjectRequest, opts ...grpc.CallOption) (*UpdateProjectResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateProjectResponse) + err := c.cc.Invoke(ctx, ProjectService_UpdateProject_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectServiceClient) DeleteProject(ctx context.Context, in *DeleteProjectRequest, opts ...grpc.CallOption) (*DeleteProjectResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteProjectResponse) + err := c.cc.Invoke(ctx, ProjectService_DeleteProject_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProjectServiceServer is the server API for ProjectService service. +// All implementations must embed UnimplementedProjectServiceServer +// for forward compatibility. +// +// Project service +type ProjectServiceServer interface { + GetProject(context.Context, *GetProjectRequest) (*GetProjectResponse, error) + CreateProject(context.Context, *CreateProjectRequest) (*CreateProjectResponse, error) + UpdateProject(context.Context, *UpdateProjectRequest) (*UpdateProjectResponse, error) + DeleteProject(context.Context, *DeleteProjectRequest) (*DeleteProjectResponse, error) + mustEmbedUnimplementedProjectServiceServer() +} + +// UnimplementedProjectServiceServer 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 UnimplementedProjectServiceServer struct{} + +func (UnimplementedProjectServiceServer) GetProject(context.Context, *GetProjectRequest) (*GetProjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProject not implemented") +} +func (UnimplementedProjectServiceServer) CreateProject(context.Context, *CreateProjectRequest) (*CreateProjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateProject not implemented") +} +func (UnimplementedProjectServiceServer) UpdateProject(context.Context, *UpdateProjectRequest) (*UpdateProjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateProject not implemented") +} +func (UnimplementedProjectServiceServer) DeleteProject(context.Context, *DeleteProjectRequest) (*DeleteProjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteProject not implemented") +} +func (UnimplementedProjectServiceServer) mustEmbedUnimplementedProjectServiceServer() {} +func (UnimplementedProjectServiceServer) testEmbeddedByValue() {} + +// UnsafeProjectServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProjectServiceServer will +// result in compilation errors. +type UnsafeProjectServiceServer interface { + mustEmbedUnimplementedProjectServiceServer() +} + +func RegisterProjectServiceServer(s grpc.ServiceRegistrar, srv ProjectServiceServer) { + // If the following call pancis, it indicates UnimplementedProjectServiceServer 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(&ProjectService_ServiceDesc, srv) +} + +func _ProjectService_GetProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServiceServer).GetProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectService_GetProject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServiceServer).GetProject(ctx, req.(*GetProjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectService_CreateProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateProjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServiceServer).CreateProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectService_CreateProject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServiceServer).CreateProject(ctx, req.(*CreateProjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectService_UpdateProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateProjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServiceServer).UpdateProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectService_UpdateProject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServiceServer).UpdateProject(ctx, req.(*UpdateProjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectService_DeleteProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteProjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServiceServer).DeleteProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectService_DeleteProject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServiceServer).DeleteProject(ctx, req.(*DeleteProjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ProjectService_ServiceDesc is the grpc.ServiceDesc for ProjectService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ProjectService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sovrabase.ProjectService", + HandlerType: (*ProjectServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetProject", + Handler: _ProjectService_GetProject_Handler, + }, + { + MethodName: "CreateProject", + Handler: _ProjectService_CreateProject_Handler, + }, + { + MethodName: "UpdateProject", + Handler: _ProjectService_UpdateProject_Handler, + }, + { + MethodName: "DeleteProject", + Handler: _ProjectService_DeleteProject_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/sovrabase.proto", +} + +const ( + OrganizationService_GetOrganization_FullMethodName = "/sovrabase.OrganizationService/GetOrganization" + OrganizationService_CreateOrganization_FullMethodName = "/sovrabase.OrganizationService/CreateOrganization" + OrganizationService_UpdateOrganization_FullMethodName = "/sovrabase.OrganizationService/UpdateOrganization" + OrganizationService_DeleteOrganization_FullMethodName = "/sovrabase.OrganizationService/DeleteOrganization" +) + +// OrganizationServiceClient is the client API for OrganizationService 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. +// +// Organization service +type OrganizationServiceClient interface { + GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*GetOrganizationResponse, error) + CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) + UpdateOrganization(ctx context.Context, in *UpdateOrganizationRequest, opts ...grpc.CallOption) (*UpdateOrganizationResponse, error) + DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest, opts ...grpc.CallOption) (*DeleteOrganizationResponse, error) +} + +type organizationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewOrganizationServiceClient(cc grpc.ClientConnInterface) OrganizationServiceClient { + return &organizationServiceClient{cc} +} + +func (c *organizationServiceClient) GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*GetOrganizationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_GetOrganization_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_CreateOrganization_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) UpdateOrganization(ctx context.Context, in *UpdateOrganizationRequest, opts ...grpc.CallOption) (*UpdateOrganizationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_UpdateOrganization_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest, opts ...grpc.CallOption) (*DeleteOrganizationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_DeleteOrganization_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OrganizationServiceServer is the server API for OrganizationService service. +// All implementations must embed UnimplementedOrganizationServiceServer +// for forward compatibility. +// +// Organization service +type OrganizationServiceServer interface { + GetOrganization(context.Context, *GetOrganizationRequest) (*GetOrganizationResponse, error) + CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) + UpdateOrganization(context.Context, *UpdateOrganizationRequest) (*UpdateOrganizationResponse, error) + DeleteOrganization(context.Context, *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) + mustEmbedUnimplementedOrganizationServiceServer() +} + +// UnimplementedOrganizationServiceServer 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 UnimplementedOrganizationServiceServer struct{} + +func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *GetOrganizationRequest) (*GetOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) UpdateOrganization(context.Context, *UpdateOrganizationRequest) (*UpdateOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) DeleteOrganization(context.Context, *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) mustEmbedUnimplementedOrganizationServiceServer() {} +func (UnimplementedOrganizationServiceServer) testEmbeddedByValue() {} + +// UnsafeOrganizationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OrganizationServiceServer will +// result in compilation errors. +type UnsafeOrganizationServiceServer interface { + mustEmbedUnimplementedOrganizationServiceServer() +} + +func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer) { + // If the following call pancis, it indicates UnimplementedOrganizationServiceServer 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(&OrganizationService_ServiceDesc, srv) +} + +func _OrganizationService_GetOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).GetOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_GetOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).GetOrganization(ctx, req.(*GetOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_CreateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, req.(*CreateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_UpdateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_UpdateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).UpdateOrganization(ctx, req.(*UpdateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_DeleteOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_DeleteOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).DeleteOrganization(ctx, req.(*DeleteOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// OrganizationService_ServiceDesc is the grpc.ServiceDesc for OrganizationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OrganizationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sovrabase.OrganizationService", + HandlerType: (*OrganizationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetOrganization", + Handler: _OrganizationService_GetOrganization_Handler, + }, + { + MethodName: "CreateOrganization", + Handler: _OrganizationService_CreateOrganization_Handler, + }, + { + MethodName: "UpdateOrganization", + Handler: _OrganizationService_UpdateOrganization_Handler, + }, + { + MethodName: "DeleteOrganization", + Handler: _OrganizationService_DeleteOrganization_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/sovrabase.proto", +} diff --git a/proto/sovrabase.proto b/proto/sovrabase.proto new file mode 100644 index 0000000..14ce3fc --- /dev/null +++ b/proto/sovrabase.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package sovrabase; + +option go_package = "github.com/ketsuna-org/sovrabase"; + +/** + +Example Proto file defining gRPC services for User, Project, and Organization management. Not intended for production use. +*/ + + +// User service +service UserService { + rpc GetUser(GetUserRequest) returns (GetUserResponse); + rpc CreateUser(CreateUserRequest) returns (CreateUserResponse); + rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse); + rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse); +} + +message GetUserRequest { + string id = 1; +} + +message GetUserResponse { + string id = 1; + string name = 2; + string email = 3; +} + +message CreateUserRequest { + string name = 1; + string email = 2; +} + +message CreateUserResponse { + string id = 1; +} + +message UpdateUserRequest { + string id = 1; + string name = 2; + string email = 3; +} + +message UpdateUserResponse { + bool success = 1; +} + +message DeleteUserRequest { + string id = 1; +} + +message DeleteUserResponse { + bool success = 1; +} + +// Project service +service ProjectService { + rpc GetProject(GetProjectRequest) returns (GetProjectResponse); + rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse); + rpc UpdateProject(UpdateProjectRequest) returns (UpdateProjectResponse); + rpc DeleteProject(DeleteProjectRequest) returns (DeleteProjectResponse); +} + +message GetProjectRequest { + string id = 1; +} + +message GetProjectResponse { + string id = 1; + string name = 2; + string description = 3; +} + +message CreateProjectRequest { + string name = 1; + string description = 2; +} + +message CreateProjectResponse { + string id = 1; +} + +message UpdateProjectRequest { + string id = 1; + string name = 2; + string description = 3; +} + +message UpdateProjectResponse { + bool success = 1; +} + +message DeleteProjectRequest { + string id = 1; +} + +message DeleteProjectResponse { + bool success = 1; +} + +// Organization service +service OrganizationService { + rpc GetOrganization(GetOrganizationRequest) returns (GetOrganizationResponse); + rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse); + rpc UpdateOrganization(UpdateOrganizationRequest) returns (UpdateOrganizationResponse); + rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse); +} + +message GetOrganizationRequest { + string id = 1; +} + +message GetOrganizationResponse { + string id = 1; + string name = 2; + string description = 3; +} + +message CreateOrganizationRequest { + string name = 1; + string description = 2; +} + +message CreateOrganizationResponse { + string id = 1; +} + +message UpdateOrganizationRequest { + string id = 1; + string name = 2; + string description = 3; +} + +message UpdateOrganizationResponse { + bool success = 1; +} + +message DeleteOrganizationRequest { + string id = 1; +} + +message DeleteOrganizationResponse { + bool success = 1; +} |
