Sha256: 2500c6629dcafac20ebbc890691556423b82ba0d675c23022bf0e330a5968031

Contents?: true

Size: 764 Bytes

Versions: 16

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Clients
    #
    # Google Public DNS enricher
    #
    class GooglePublicDNS < Base
      #
      # @param [String] base_url
      # @param [Hash] headers
      # @param [Integer, nil] timeout
      #
      def initialize(base_url = "https://dns.google", headers: {}, timeout: nil)
        super(base_url, headers: headers, timeout: timeout)
      end

      #
      # Query Google Public DNS by resource type
      #
      # @param [String] name
      #
      # @return [Mihari::Structs::GooglePublicDNS::Response, nil]
      #
      def query_all(name)
        Structs::GooglePublicDNS::Response.from_dynamic! get_json("/resolve",
          params: { name: name, type: "ALL" })
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mihari-7.3.2 lib/mihari/clients/google_public_dns.rb
mihari-7.3.1 lib/mihari/clients/google_public_dns.rb
mihari-7.3.0 lib/mihari/clients/google_public_dns.rb
mihari-7.2.0 lib/mihari/clients/google_public_dns.rb
mihari-7.1.3 lib/mihari/clients/google_public_dns.rb
mihari-7.1.2 lib/mihari/clients/google_public_dns.rb
mihari-7.1.1 lib/mihari/clients/google_public_dns.rb
mihari-7.1.0 lib/mihari/clients/google_public_dns.rb
mihari-7.0.5 lib/mihari/clients/google_public_dns.rb
mihari-7.0.4 lib/mihari/clients/google_public_dns.rb
mihari-7.0.3 lib/mihari/clients/google_public_dns.rb
mihari-7.0.2 lib/mihari/clients/google_public_dns.rb
mihari-7.0.1 lib/mihari/clients/google_public_dns.rb
mihari-7.0.0 lib/mihari/clients/google_public_dns.rb
mihari-6.3.0 lib/mihari/clients/google_public_dns.rb
mihari-6.2.0 lib/mihari/clients/google_public_dns.rb