# Config

    public class Config

Config is a class that wraps a golang `config` object

Should not be used on its own

Show on GitHub

- `init(_:)`

  Class constructor using a golang `config` object passed as parameter as config instance

  #### Declaration

  Swift

      public init(_ config: CoreConfig)

  #### Parameters

  `config` | A golang `config` object

  Show on GitHub
- `defaultConfig()`

  Returns a default golang `config` object

  Throws

  `ConfigError`: If the creation of the config failed

  #### Declaration

  Swift

      public class func defaultConfig() throws -> Config

  #### Return Value

  A golang `config` object

  Show on GitHub
- `emptyConfig()`

  Returns an empty golang `config` object

  Throws

  `ConfigError`: If the creation of the config failed

  #### Declaration

  Swift

      public class func emptyConfig() throws -> Config

  #### Return Value

  A golang `config` object

  Show on GitHub
- `configFromDict(_:)`

  Returns a golang `config` object based on the dict passed as parameter

  Throws

  `ConfigError`: If the creation of the config failed

  #### Declaration

  Swift

      public class func configFromDict(_ dict: [String : Any]) throws -> Config

  #### Parameters

  `dict` | The dict containing the config to create

  #### Return Value

  A golang `config` object

  Show on GitHub
- `get()`

  Gets the config as a dict

  Throws

  `ConfigError`: If the getting of the config failed

  #### Declaration

  Swift

      public func get() throws -> [String : Any]

  #### Return Value

  A dict containing the config

  Show on GitHub
- `setKey(_:_:)`

  Sets a key and its value in the config

  Throws

  `ConfigError`: If the setting of the key failed

  #### Declaration

  Swift

      public func setKey(_ key: String, _ value: [String : Any]) throws

  #### Parameters

  `key` | The key to set
  `value` | A dict containing the value to set

  Show on GitHub
- `getKey(_:)`

  Gets the value associated to the key passed as parameter in the config

  Throws

  `ConfigError`: If the getting of the key failed

  #### Declaration

  Swift

      public func getKey(_ key: String) throws -> [String : Any]

  #### Parameters

  `key` | The key to get

  #### Return Value

  A dict containing the value associated to the key passed as parameter

  Show on GitHub

© 2022 . All rights reserved. (Last updated: 2022-12-05)

Generated by jazzy ♪♫ v0.14.3, a Realm project.