-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Nager.PublicSuffix.Extensions; | ||
using Nager.PublicSuffix.Models; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Nager.PublicSuffix.RuleProviders | ||
{ | ||
/// <summary> | ||
/// BaseRuleProvider | ||
/// </summary> | ||
public abstract class BaseRuleProvider : IRuleProvider | ||
{ | ||
protected DomainDataStructure _domainDataStructure; | ||
Check warning on line 14 in src/Nager.PublicSuffix/RuleProviders/BaseRuleProvider.cs GitHub Actions / build
Check warning on line 14 in src/Nager.PublicSuffix/RuleProviders/BaseRuleProvider.cs GitHub Actions / build
Check warning on line 14 in src/Nager.PublicSuffix/RuleProviders/BaseRuleProvider.cs GitHub Actions / build
Check warning on line 14 in src/Nager.PublicSuffix/RuleProviders/BaseRuleProvider.cs GitHub Actions / build
Check warning on line 14 in src/Nager.PublicSuffix/RuleProviders/BaseRuleProvider.cs GitHub Actions / build
|
||
|
||
/// <inheritdoc/> | ||
public abstract Task<bool> BuildAsync( | ||
bool ignoreCache = false, | ||
CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Create a DomainDataStructure | ||
/// </summary> | ||
/// <param name="rules"></param> | ||
protected void CreareDomainDataStructure(IEnumerable<TldRule> rules) | ||
{ | ||
var domainDataStructure = new DomainDataStructure("*", new TldRule("*")); | ||
domainDataStructure.AddRules(rules); | ||
|
||
this._domainDataStructure = domainDataStructure; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public DomainDataStructure? GetDomainDataStructure() | ||
{ | ||
return this._domainDataStructure; | ||
} | ||
} | ||
} |
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