-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format/Carrier now almost equal to Java implementation
- Loading branch information
Showing
19 changed files
with
105 additions
and
156 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
13 changes: 0 additions & 13 deletions
13
src/OpenTracing.BasicTracer/Propagation/IExtractCarrierHandler.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/OpenTracing.BasicTracer/Propagation/IInjectCarrierHandler.cs
This file was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System; | ||
|
||
namespace OpenTracing.Propagation | ||
{ | ||
/// <summary> | ||
/// Format instances control the behavior of <see cref="ITracer.Inject" /> and <see cref="ITracer.Extract" /> | ||
/// (and also constrain the type of the carrier parameter to same). | ||
/// </summary> | ||
public class Format<TCarrier> : IEquatable<Format<TCarrier>> | ||
{ | ||
/// <summary> | ||
/// The unique name for this format. | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
public Format(string name) | ||
{ | ||
if (string.IsNullOrWhiteSpace(name)) | ||
{ | ||
throw new ArgumentNullException(nameof(name)); | ||
} | ||
|
||
Name = name; | ||
} | ||
|
||
/// <summary> | ||
/// Two format instances are equal when they have the same <see cref="Name" />. | ||
/// </summary> | ||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (ReferenceEquals(this, obj)) return true; | ||
if (obj.GetType() != GetType()) return false; | ||
|
||
return Equals(obj as Format<TCarrier>); | ||
} | ||
|
||
/// <summary> | ||
/// Two format instances are equal when they have the same <see cref="Name" />. | ||
/// </summary> | ||
public bool Equals(Format<TCarrier> other) | ||
{ | ||
if (other == null) | ||
{ | ||
return false; | ||
} | ||
|
||
return string.Equals(Name, other.Name); | ||
} | ||
|
||
/// <summary> | ||
/// Two format instances are equal when they have the same <see cref="Name" />. | ||
/// </summary> | ||
public override int GetHashCode() | ||
{ | ||
return Name.GetHashCode(); | ||
} | ||
} | ||
} |
Oops, something went wrong.