Class: Puppet::Plugins::DataProviders::Registry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/plugins/data_providers/registry.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0

Class Method Summary collapse

Class Method Details

.hash_of_environment_data_providersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0



20
21
22
23
# File 'lib/puppet/plugins/data_providers/registry.rb', line 20

def self.hash_of_environment_data_providers
  @@HASH_OF_ENV_DATA_PROVIDERS ||= Puppet::Pops::Types::TypeFactory.hash_of(
    Puppet::Pops::Types::TypeFactory.type_of(ENV_DATA_PROVIDERS_TYPE))
end

.hash_of_module_data_providersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0



15
16
17
18
# File 'lib/puppet/plugins/data_providers/registry.rb', line 15

def self.hash_of_module_data_providers
  @@HASH_OF_MODULE_DATA_PROVIDERS ||= Puppet::Pops::Types::TypeFactory.hash_of(
    Puppet::Pops::Types::TypeFactory.type_of(MODULE_DATA_PROVIDERS_TYPE))
end

.hash_of_path_based_data_provider_factoriesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0



25
26
27
28
# File 'lib/puppet/plugins/data_providers/registry.rb', line 25

def self.hash_of_path_based_data_provider_factories
  @@HASH_OF_PATH_BASED_DATA_PROVIDER_FACTORIES ||= Puppet::Pops::Types::TypeFactory.hash_of(
    Puppet::Pops::Types::TypeFactory.type_of(PATH_BASED_DATA_PROVIDER_FACTORIES_TYPE))
end

.hash_of_per_module_data_providerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0



11
12
13
# File 'lib/puppet/plugins/data_providers/registry.rb', line 11

def self.hash_of_per_module_data_provider
  @@HASH_OF_PER_MODULE_DATA_PROVIDERS ||= Puppet::Pops::Types::TypeFactory.hash_of(PER_MODULE_DATA_PROVIDER_TYPE)
end

.register_defaults(default_bindings) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers a ‘none’ environment data provider, and a ‘none’ module data provider as the defaults. This is only done to allow that something binds to ‘none’ rather than removing the entire binding (which has the same effect).

Since:

  • Puppet 4.0.0



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/puppet/plugins/data_providers/registry.rb', line 34

def self.register_defaults(default_bindings)
  default_bindings.bind do
    name('none')
    in_multibind(ENV_DATA_PROVIDERS_KEY)
    to_instance(ENV_DATA_PROVIDERS_TYPE)
  end

  default_bindings.bind do
    name('function')
    in_multibind(ENV_DATA_PROVIDERS_KEY)
    to_instance('Puppet::DataProviders::FunctionEnvDataProvider')
  end

  default_bindings.bind do
    name('hiera')
    in_multibind(ENV_DATA_PROVIDERS_KEY)
    to_instance('Puppet::DataProviders::HieraEnvDataProvider')
  end

  default_bindings.bind do
    name('none')
    in_multibind(MODULE_DATA_PROVIDERS_KEY)
    to_instance(MODULE_DATA_PROVIDERS_TYPE)
  end

  default_bindings.bind do
    name('function')
    in_multibind(MODULE_DATA_PROVIDERS_KEY)
    to_instance('Puppet::DataProviders::FunctionModuleDataProvider')
  end

  default_bindings.bind do
    name('hiera')
    in_multibind(MODULE_DATA_PROVIDERS_KEY)
    to_instance('Puppet::DataProviders::HieraModuleDataProvider')
  end

  default_bindings.bind do
    name('json')
    in_multibind(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY)
    to_instance('Puppet::DataProviders::JsonDataProviderFactory')
  end

  default_bindings.bind do
    name('yaml')
    in_multibind(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY)
    to_instance('Puppet::DataProviders::YamlDataProviderFactory')
  end
end

.register_extensions(extensions) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • Puppet 4.0.0



4
5
6
7
8
9
# File 'lib/puppet/plugins/data_providers/registry.rb', line 4

def self.register_extensions(extensions)
  extensions.multibind(PER_MODULE_DATA_PROVIDER_KEY).name(PER_MODULE_DATA_PROVIDER_KEY).hash_of(PER_MODULE_DATA_PROVIDER_TYPE)
  extensions.multibind(ENV_DATA_PROVIDERS_KEY).name(ENV_DATA_PROVIDERS_KEY).hash_of(ENV_DATA_PROVIDERS_TYPE)
  extensions.multibind(MODULE_DATA_PROVIDERS_KEY).name(MODULE_DATA_PROVIDERS_KEY).hash_of(MODULE_DATA_PROVIDERS_TYPE)
  extensions.multibind(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY).name(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY).hash_of(PATH_BASED_DATA_PROVIDER_FACTORIES_TYPE)
end