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
configobject passed as parameter as config instanceDeclaration
Swift
public init(_ config: CoreConfig)Parameters
configA golang
configobject -
Returns a default golang
configobjectThrows
ConfigError: If the creation of the config failedDeclaration
Swift
public class func defaultConfig() throws -> ConfigReturn Value
A golang
configobject -
Returns an empty golang
configobjectThrows
ConfigError: If the creation of the config failedDeclaration
Swift
public class func emptyConfig() throws -> ConfigReturn Value
A golang
configobject -
Returns a golang
configobject based on the dict passed as parameterThrows
ConfigError: If the creation of the config failedDeclaration
Swift
public class func configFromDict(_ dict: [String : Any]) throws -> ConfigParameters
dictThe dict containing the config to create
Return Value
A golang
configobject -
Gets the config as a dict
Throws
ConfigError: If the getting of the config failedDeclaration
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 failedDeclaration
Swift
public func setKey(_ key: String, _ value: [String : Any]) throwsParameters
keyThe key to set
valueA 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 failedDeclaration
Swift
public func getKey(_ key: String) throws -> [String : Any]Parameters
keyThe key to get
Return Value
A dict containing the value associated to the key passed as parameter
View on GitHub
Config Class Reference