module Fluent::Plugin::Bind::Utils
Utilities related to bind/named
Constants
- FLAGS_REGEXP
Public Class Methods
parse_flags(flags, prefix: '')
click to toggle source
# File lib/fluent/plugin/bind/utils.rb, line 19 def self.parse_flags(flags, prefix: '') m = FLAGS_REGEXP.match(flags) return {} unless m parsed_flags = {} m.names.each do |name| parsed_flags[prefix + name] = !m[name].nil? end parsed_flags["#{prefix}recursion"] = m['recursion'] == '+' parsed_flags["#{prefix}edns_version"] = m['edns_version'] ? m['edns_version'].to_i : nil parsed_flags["#{prefix}valid_server_cookie"] = case m['valid_server_cookie'] when 'V' then true when 'K' then false end parsed_flags end