-
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.
docs: Documentation for public protocols/constructors (#111)
* Remove unused timeout parameter * docs: In-code docs for public protocols/constructors
- Loading branch information
1 parent
0ca65ea
commit 01dda08
Showing
8 changed files
with
103 additions
and
60 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import Foundation | ||
|
||
/// A Contextual implementer returns the current context | ||
/** | ||
A Contextual implementer returns the current context | ||
*/ | ||
public protocol ConfidenceContextProvider { | ||
func getContext() -> ConfidenceStruct | ||
} |
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,6 +1,12 @@ | ||
import Foundation | ||
|
||
/// Sends events to Confidence. Contextual data is appended to each event | ||
/** | ||
Sends events to Confidence. Contextual data is appended to each event | ||
*/ | ||
public protocol ConfidenceEventSender: Contextual { | ||
/** | ||
Upon return, the event has been correctly stored and will be emitted to the backend | ||
according to the configured flushing logic | ||
*/ | ||
func track(eventName: String, message: ConfidenceStruct) | ||
} |
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,14 +1,26 @@ | ||
import Foundation | ||
|
||
/// A Contextual implementer maintains local context data and can create child instances | ||
/// that can still access their parent's data | ||
/// Each ConfidenceContextProvider returns local data reconciled with parents' data. Local data has precedence | ||
/** | ||
A Contextual implementer maintains local context data and can create child instances | ||
that can still access their parent's data | ||
Each ConfidenceContextProvider returns local data reconciled with parents' data. Local data has precedence | ||
*/ | ||
public protocol Contextual: ConfidenceContextProvider { | ||
/// Adds/override entry to local data | ||
/** | ||
Adds/override entry to local data | ||
*/ | ||
func putContext(key: String, value: ConfidenceValue) | ||
/// Removes entry from local data | ||
/// It hides entries with this key from parents' data (without modifying parents' data) | ||
func removeContextEntry(key: String) | ||
/// Creates a child Contextual instance that maintains access to its parent's data | ||
/** | ||
Removes entry from local data | ||
It hides entries with this key from parents' data (without modifying parents' data) | ||
*/ | ||
func removeKey(key: String) | ||
/** | ||
Perform `putContext` and multiple `removeKey` at once | ||
*/ | ||
func putContext(context: ConfidenceStruct, removeKeys: [String]) | ||
/** | ||
Creates a child Contextual instance that maintains access to its parent's data | ||
*/ | ||
func withContext(_ context: ConfidenceStruct) -> 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
import Foundation | ||
|
||
/// Flag resolve configuration related to how to refresh flags at startup | ||
/** | ||
Flag resolve configuration related to how to refresh flags at startup | ||
*/ | ||
public enum InitializationStrategy { | ||
case fetchAndActivate, activateAndFetchAsync | ||
/** | ||
Flags are resolved before the values are accessible by the application | ||
*/ | ||
case fetchAndActivate | ||
/** | ||
Values in the cache are accessible right away, an asynchronous resolve | ||
updates the cache for a future session | ||
*/ | ||
case activateAndFetchAsync | ||
} |
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
Oops, something went wrong.