项目作者: slashmo

项目描述 :
Server-Side Swift example application
高级语言: Swift
项目地址: git://github.com/slashmo/swift-fruitstore-example.git
创建时间: 2021-04-19T13:39:26Z
项目社区:https://github.com/slashmo/swift-fruitstore-example

开源协议:

下载


Server-Side Swift Example: FruitStore

This repo contains an example that showcases various aspects of the Server-Side Swift ecosystem.
It’s a microservices-oriented set of APIs, instrumented using Logging,
Metrics,
and Distributed Tracing.

Running locally

Each service is contained in its own Swift package, located under /services/<service-name>.

Docker 🐳

Traces are exported to an OpenTelemetry Collector running in a Docker container, and visualized via Jaeger.
Both of these containers may be started through docker-compose.yaml:

  1. docker-compose up -d

⚠️ Latest Swift Toolchain

This example makes use of yet to be release Swift features such as async/await and task locals.
Therefore you’ll need to have the latest development snapshot of Swift installed on a Mac.

You also need to specify the DYLD_LIBRARY_PATH to be able to run the executables:

  1. export DYLD_LIBRARY_PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib/swift/macosx

To run the Storage service, build and execute storagectl:

  1. cd services/storage
  2. swift build && ./.build/debug/storagectl serve --log-level trace