-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic EvaluationContext wiring in events
- Loading branch information
1 parent
23c6ebd
commit 839db71
Showing
7 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,11 @@ let package = Package( | |
.package(url: "[email protected]:open-feature/swift-sdk.git", from: "0.1.0"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "Confidence", | ||
dependencies: [], | ||
plugins: [] | ||
), | ||
.target( | ||
name: "ConfidenceProvider", | ||
dependencies: [ | ||
|
@@ -29,11 +34,6 @@ let package = Package( | |
], | ||
plugins: [] | ||
), | ||
.target( | ||
name: "Confidence", | ||
dependencies: [], | ||
plugins: [] | ||
), | ||
.testTarget( | ||
name: "ConfidenceProviderTests", | ||
dependencies: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import Foundation | ||
|
||
/// Sends events to Confidence. Contextual data is appended to each event | ||
// TODO: Add functions for sending events with payload | ||
public protocol ConfidenceEventSender: Contextual { | ||
func send(eventName: String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import Foundation | ||
|
||
/// A Contextual implementer maintains context data and can create child instances | ||
/// that can still access their parent's data | ||
public protocol Contextual { | ||
var context: [String: String] { get set } // TODO Introdue complex types | ||
// TODO: Add complex type to the context Dictionary | ||
var context: [String: String] { get set } | ||
|
||
func updateContextEntry(key: String, value: String) | ||
func removeContextEntry(key: String) | ||
func clearContext() | ||
|
||
/// Creates a child Contextual instance that still has access | ||
/// to its parent context | ||
func withContext(_ context: [String: String]) -> Self | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters