import json


def _load_config(path):
    """
    Load a JSON config from file.

    :param path: The path to the config.
    :type path: pathlib.Path
    """
    with path.open() as file:
        config = json.load(file)

    required_keys = [
        'port',
        'rate',
        'drone',
        'archives',
    ]
    for key in required_keys:
        if key not in config:
            raise ValueError('`{}` not specified in config'.format(key))

    return config