Sha256: 87379d5acc646c2acd393e15acf9fc1048864190c16b6e19c823be9a8f9fb915

Contents?: true

Size: 591 Bytes

Versions: 6

Compression:

Stored size: 591 Bytes

Contents

require 'mastodon_healthchecker/dns_records'
require 'mastodon_healthchecker/instance_info'
require 'mastodon_healthchecker/version'

module MastodonHealthchecker
  Result = Struct.new('Result', :exists_record, :up, :info)

  def self.perform(host)
    records = DNSRecords.new(host)
    info_v4 = InstanceInfo.fetch(host, records.v4_addresses)
    info_v6 = InstanceInfo.fetch(host, records.v6_addresses)

    Result.new(
      { v4: records.v4_addresses.any?, v6: records.v6_addresses.any? },
      { v4: !info_v4.nil?, v6: !info_v6.nil? },
      info_v4 || info_v6 || nil
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mastodon_healthchecker-0.1.0.pre.8 lib/mastodon_healthchecker.rb
mastodon_healthchecker-0.1.0.pre.7 lib/mastodon_healthchecker.rb
mastodon_healthchecker-0.1.0.pre.6 lib/mastodon_healthchecker.rb
mastodon_healthchecker-0.1.0.pre.5 lib/mastodon_healthchecker.rb
mastodon_healthchecker-0.1.0.pre.4 lib/mastodon_healthchecker.rb
mastodon_healthchecker-0.1.0.pre.3 lib/mastodon_healthchecker.rb