Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
minor rewordings in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso committed Oct 7, 2020
1 parent d6550fe commit b85eace
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
# 🧳 Distributed Tracing Baggage Core

> 📔 **NOTE**: It is very unlikely that you want to depend on _this_ package itself.
> Most libraries and projects should depend on and use the https://github.com/apple/swift-distributed-tracing-baggage package instead.
> And consider baggage an implementation detail, unless avoiding the `SwiftLog` dependency is necessary.
`Baggage` is a minimal (zero-dependency) context propagation container, intended to "carry" baggage items
for purposes of cross-cutting tools to be built on top of it.

It is modeled after the concepts explained in [W3C Baggage](https://w3c.github.io/baggage/) and the
in the spirit of [Tracing Plane](https://cs.brown.edu/~jcmace/papers/mace18universal.pdf) baggage context type,
although by itself it does not define a specific serialization format.
in the spirit of [Tracing Plane](https://cs.brown.edu/~jcmace/papers/mace18universal.pdf) 's "Baggage Context" type,
although by itself it does not define a specific serialization format.

Please refer to [Swift Distributed Tracing Baggage](https://github.com/apple/swift-distributed-tracing-baggage)
and [Swift Distributed Tracing](https://github.com/apple/swift-distributed-tracing) for usage guides of this type.

## Dependency

## Dependencies

It should be noted that most libraries and frameworks do NOT need to depend on this package explicitly,
but rather should depend on [Swift Distributed Tracing Baggage](https://github.com/apple/swift-distributed-tracing-baggage) or [Swift Distributed Tracing](https://github.com/apple/swift-distributed-tracing) which will pull the
`CoreBaggage` via their transitive dependencies. This package and the `CoreBaggage` module exist only for
libraries which want to maintain an absolutely minimal dependency footprint, and e.g. do not want to depend on `Logging` modules, which the higher level packages may do.

## Installation

You can install the `BaggageContext` library through the Swift Package Manager. The library itself is called `Baggage`,
so that's what you'd import in your Swift files.
In order to depend on this library you can use the Swift Package Manager, and add the following dependency to your `Package.swift`:

```swift
dependencies: [
Expand All @@ -33,7 +28,7 @@ dependencies: [
]
```

and depend on the module:
and depend on the module in your target:

```swift
targets: [
Expand All @@ -49,8 +44,10 @@ targets: [

## Usage

Please refer to [Swift Distributed Tracing Baggage](https://github.com/apple/swift-distributed-tracing-baggage) for the intended usage.
Please refer to [Swift Distributed Tracing Baggage](https://github.com/apple/swift-distributed-tracing-baggage) for the intended usage,
and detailed guidelines.

Alternatively, please refer to the API documentation of the Baggage type.

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions Sources/CoreBaggage/Baggage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ extension Baggage {
return self._storage.count
}

public var isEmpty: Bool {
return self._storage.isEmpty
}

/// Calls the given closure for each item contained in the underlying `Baggage`.
///
/// Order of those invocations is NOT guaranteed and should not be relied on.
Expand Down

0 comments on commit b85eace

Please sign in to comment.