Config

public class Config

Config is a class that wraps a golang config object

Should not be used on its own

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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