DarkPeakLabs.PublicSuffix 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package DarkPeakLabs.PublicSuffix --version 1.0.3                
NuGet\Install-Package DarkPeakLabs.PublicSuffix -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DarkPeakLabs.PublicSuffix" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DarkPeakLabs.PublicSuffix --version 1.0.3                
#r "nuget: DarkPeakLabs.PublicSuffix, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DarkPeakLabs.PublicSuffix as a Cake Addin
#addin nuget:?package=DarkPeakLabs.PublicSuffix&version=1.0.3

// Install DarkPeakLabs.PublicSuffix as a Cake Tool
#tool nuget:?package=DarkPeakLabs.PublicSuffix&version=1.0.3                

PublicSuffix

A simple tread-safe library providing programmatic access to the public suffix list published at https://publicsuffix.org/.

Usage

The PublicSuffixList class implements IReadOnlyList<string> interface.

Example: list all rules

PublicSuffixList list = new();
foreach(var rule in list) 
{
	Console.WriteLine(rule);
}

Example: get apex domain

PublicSuffixList list = new();
var apexDomain = list.GetApexDomain("store.example.co.uk");
// will output 'example.co.uk'
Console.WriteLine(apexDomain);

By default the class will download the list from https://publicsuffix.org/list/public_suffix_list.dat and cache it in PublicSuffix/public_suffix_list.dat under the common application folder. Exclusive access to file is used for inter-process synchronization to guarantee only one instance of the class is creating or updating the cached data. By default the file is updated every 24 hours. Both the download URL and the data refresh time can be configured.

Optionally, an instance of the ILoggerFactory can be passed to the constructor to have inner log messages emitted.

Example: Update data every 12 hours

var options = new PublicSuffixListOptions() 
{
    UpdateAfter = TimeSpan.FromHours(12),
};

PublicSuffixList list = new(options, _loggerFactory);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 78 10/30/2024
1.0.3 78 10/30/2024
1.0.2 73 10/30/2024
1.0.1 72 10/30/2024
1.0.0 75 10/28/2024