{"id":18036040,"url":"https://github.com/darvld/krpc","last_synced_at":"2025-03-27T08:30:38.557Z","repository":{"id":48238091,"uuid":"382937943","full_name":"darvld/krpc","owner":"darvld","description":"An idiomatic Kotlin gRPC library.","archived":true,"fork":false,"pushed_at":"2022-05-14T00:13:27.000Z","size":400,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T18:18:30.498Z","etag":null,"topics":["grpc","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darvld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-04T19:59:22.000Z","updated_at":"2024-09-02T12:41:39.000Z","dependencies_parsed_at":"2022-08-19T16:01:33.103Z","dependency_job_id":null,"html_url":"https://github.com/darvld/krpc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darvld%2Fkrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darvld%2Fkrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darvld%2Fkrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darvld%2Fkrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darvld","download_url":"https://codeload.github.com/darvld/krpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245809588,"owners_count":20676013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","kotlin"],"created_at":"2024-10-30T12:11:23.176Z","updated_at":"2025-03-27T08:30:38.058Z","avatar_url":"https://github.com/darvld.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin RPC\n\n[![CodeFactor](https://www.codefactor.io/repository/github/darvld/krpc/badge/main)](https://www.codefactor.io/repository/github/darvld/krpc/overview/main)\n[![CI](https://github.com/darvld/krpc/actions/workflows/ci.yml/badge.svg)](https://github.com/darvld/krpc/actions/workflows/ci.yml)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.darvld.krpc/krpc-runtime.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.darvld.krpc%22%20AND%20a:%22krpc-runtime%22)\n\nA Kotlin Multiplatform library to generate and consume gRPC services directly from Kotlin. Check out\nthe [Sample project](https://github.com/darvld/krpc/tree/main/sample) to see a full list of available features, or see\nthe [Quick Start](docs/Basic.md) guide on how to add kRPC to your project.\n\n\u003e **Note:** At the moment, only Kotlin/JVM is supported as a target platform for code generation.\n\n## Overview\n\nInstead of using Protoc and .proto files to define services, kRPC uses Kotlin's interfaces and annotations. Any\ninterface annotated with `@Service` will be recognized as a definition by the kRPC compiler:\n\n```kotlin\n@Service\ninterface GpsService {\n    @UnaryCall\n    suspend fun locationForVehicle(vehicle: Vehicle): Location\n}\n```\n\nThe methods inside the service definitions should have the proper annotation to reflect the type of RPC call:\n\n- `@UnaryCall` defines a single-request, single-response rpc method, suspending until the server replies.\n- `@ServerStream` takes a single request and returns a response `Flow`, which you can later use to consume the responses\n  streamed by the server. Server-stream methods don't suspend, instead the returned flow collector will suspend until\n  the first value is received.\n- `@ClientStream` takes a request flow and returns a single response, suspending until it is received.\n- `@BidiStream` takes a request flow and returns response flow, thus enabling bidirectional streaming. Like\n  with `@ServerStream`, this method does not suspend.\n\nMethod parameters and return types must be serializable.\n\nThe compiler will then generate two implementations of this interface: an abstract service provider, and a client.\nAdditionally, a helper class is generated: the service's Descriptor, which contains all the generated method\ndescriptors (on JVM) and can be used to create your own custom client/server implementations.\n\n## Implementation\n\nThe kRPC compiler uses Google's [KSP](https://github.com/google/ksp) to process the annotations and then generates code\nwith [KotlinPoet](). On JVM, the runtime and generated stubs are implemented on top of\nthe [grpc-kotlin-stub](https://github.com/grpc/grpc-kotlin)\nruntime.\n\n## Resources\n\n- [Getting Started](docs/Basic.md)\n- [Service Definitions](docs/Advanced.md)\n- [Roadmap](docs/Roadmap.md)\n\nIf you find the project useful, have an idea on how to improve it or if you find a bug, consider making a contribution\nor opening a new issue. Pull requests are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarvld%2Fkrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarvld%2Fkrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarvld%2Fkrpc/lists"}