## Config


Configuration holder for connections.


Usage


``` python
Config(
    host,
    port=5432,
)
```


## Parameters


`host: str`  
Server hostname.

`port: int = ``5432`  
Port number.


## Examples

``` python
>>> cfg = Config("localhost", 5432)
>>> cfg.host
```

'localhost'


## Methods

| Name | Description |
|----|----|
| [as_dict()](#as_dict) | Return configuration as a dictionary. |
| [validate()](#validate) | Validate the configuration. |

------------------------------------------------------------------------


#### as_dict()


Return configuration as a dictionary.


Usage


``` python
as_dict()
```


##### Returns


`dict`  
Keys are `host` and `port`.


------------------------------------------------------------------------


#### validate()


Validate the configuration.


Usage


``` python
validate()
```


##### Returns


`bool`  
True if the configuration is valid.


##### Raises


`ValueError`  
If the host is empty or port is out of range.
