def requires_service(service_type='http'):
    """Sets function attribute required_service_type to service_type."""

    def decorator(func):
        func.required_service_type = service_type
        return func
    return decorator