Giter Site home page Giter Site logo

muizidn / grpc-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grpc/grpc-swift

0.0 0.0 0.0 10.84 MB

The Swift language implementation of gRPC. For Carthage usage.

License: Apache License 2.0

Swift 96.89% Makefile 0.52% Ruby 0.11% Shell 2.48%
carthage

grpc-swift's Introduction

Build Status

gRPC Swift

This repository contains a gRPC Swift API and code generator.

It is intended for use with Apple's SwiftProtobuf support for Protocol Buffers. Both projects contain code generation plugins for protoc, Google's Protocol Buffer compiler, and both contain libraries of supporting code that is needed to build and run the generated code.

APIs and generated code is provided for both gRPC clients and servers, and can be built either with Xcode or the Swift Package Manager. Support is provided for all four gRPC API styles (Unary, Server Streaming, Client Streaming, and Bidirectional Streaming) and connections can be made either over secure (TLS) or insecure channels.

gRPC Swift is built on top of Swift NIO as opposed to the core library provided by the gRPC project.

Supported Platforms

gRPC Swift's platform support is identical to the platform support of Swift NIO.

Note that gRPC Swift uses NIO 2 and therefore requires Swift to be version 5.0 or higher.

Getting gRPC Swift

There are two parts to gRPC Swift: the gRPC library and an API code generator.

Getting the gRPC library

Swift Package Manager

The Swift Package Manager is the preferred way to get gRPC Swift. Simply add the package dependency to your Package.swift and depend on "GRPC" in the necessary targets:

dependencies: [
  .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0-alpha.9")
]
Xcode

From Xcode 11 it is possible to add Swift Package dependencies to Xcode projects and link targets to products of those packages; this is the easiest way to integrate gRPC Swift with an existing xcodeproj.

Manual Integration

Alternatively, gRPC Swift can be manually integrated into a project:

  1. Build an Xcode project: swift package generate-xcodeproj,
  2. Add the generated project to your own project, and
  3. Add a build dependency on GRPC.

CocoaPods

CocoaPods support will be added in v1.0.

Getting the protoc Plugins

Binary releases of protoc, the Protocol Buffer Compiler, are available on GitHub.

To build the plugins, run make plugins in the main directory. This uses the Swift Package Manager to build both of the necessary plugins: protoc-gen-swift, which generates Protocol Buffer support code and protoc-gen-grpc-swift, which generates gRPC interface code.

To install these plugins, just copy the two executables (protoc-gen-swift and protoc-gen-grpc-swift) that show up in the main directory into a directory that is part of your PATH environment variable. Alternatively the full path to the plugins can be specified when using protoc.

Using gRPC Swift

gRPC Swift has a number of tutorials and examples available:

  • A quick start guide for creating and running your first gRPC service.
  • A basic tutorial covering the creation and implementation of a gRPC service using all four call types as well as the code required to setup and run a server and make calls to it using a generated client.

The docs directory contains other documenation, including:

License

gRPC Swift is released under the same license as gRPC, repeated in LICENSE.

Contributing

Please get involved! See our guidelines for contributing.

grpc-swift's People

Contributors

timburks avatar mrmage avatar glbrntt avatar rebello95 avatar armstrongnate avatar chemidy avatar mpetrov avatar takasek avatar jonasvautherin avatar cvanderschuere avatar kevints avatar kyoheig3 avatar ishkawa avatar sergiocampama avatar acchou avatar tikidunpon avatar ryanwilson avatar muizidn avatar bootstraponline avatar tsabirgaliev avatar sebastianthiebaud avatar mickeyreiss avatar johndpope avatar bmhatfield avatar bgetsug avatar slavabulgakov avatar jgh- avatar fabstu avatar williamizzo83 avatar allevato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.