using System; using System.Net; namespace FastGithub.Scanner { sealed class GithubContext : IEquatable { /// /// 获取域名 /// public string Domain { get; } /// /// 获取ip /// public IPAddress Address { get; } /// /// 获取或设置是否可用 /// public bool Available { get; set; } /// /// 获取统计信息 /// public GithubContextStatistics Statistics { get; } = new(); public GithubContext(string domain, IPAddress address) { this.Domain = domain; this.Address = address; } public override bool Equals(object? obj) { return obj is GithubContext other && this.Equals(other); } public bool Equals(GithubContext? other) { return other != null && other.Address.Equals(this.Address) && other.Domain == this.Domain; } public override int GetHashCode() { return HashCode.Combine(this.Domain, this.Address); } } }