Sha256: b11b4a6872abdd2dbd72b3581e432ec9dea53bf5afecaf5254d7ea3cf6016149

Contents?: true

Size: 1.59 KB

Versions: 93

Compression:

Stored size: 1.59 KB

Contents

#
# Fluentd
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

require 'fluent/plugin/base'

require 'fluent/log'
require 'fluent/unique_id'
require 'fluent/plugin_id'

module Fluent
  module Plugin
    class ServiceDiscovery < Base
      include PluginId
      include PluginLoggerMixin
      include UniqueId::Mixin

      configured_in :service_discovery

      attr_reader :services

      Service = Struct.new(:plugin_name, :host, :port, :name, :weight, :standby, :username, :password, :shared_key) do
        def discovery_id
          @discovery_id ||= Base64.encode64(to_h.to_s)
        end
      end

      SERVICE_IN = :service_in
      SERVICE_OUT = :service_out
      DiscoveryMessage = Struct.new(:type, :service)

      class << self
        def service_in_msg(service)
          DiscoveryMessage.new(SERVICE_IN, service)
        end

        def service_out_msg(service)
          DiscoveryMessage.new(SERVICE_OUT, service)
        end
      end

      def initialize
        @services = []

        super
      end

      def start(queue = nil)
        super()
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 7 rubygems

Version Path
fluentd-1.16.4-x64-mingw-ucrt lib/fluent/plugin/service_discovery.rb
fluentd-1.16.4-x86-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.4-x64-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.4 lib/fluent/plugin/service_discovery.rb
fluentd222-1.16.2-x86_64-linux lib/fluent/plugin/service_discovery.rb
fluentd-1.16.3-x86-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.3-x64-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.3-x64-mingw-ucrt lib/fluent/plugin/service_discovery.rb
fluentd-1.16.3 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.2-x86-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.2-x64-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.2-x64-mingw-ucrt lib/fluent/plugin/service_discovery.rb
fluentd-1.16.2 lib/fluent/plugin/service_discovery.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/fluentd-1.16.1/lib/fluent/plugin/service_discovery.rb
fluentd-1.16.1-x64-mingw-ucrt lib/fluent/plugin/service_discovery.rb
fluentd-1.16.1-x64-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.1-x86-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.1 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.0-x64-mingw32 lib/fluent/plugin/service_discovery.rb
fluentd-1.16.0-x64-mingw-ucrt lib/fluent/plugin/service_discovery.rb