def service_to_corelf(service):
    """Convert a service dict to CoRE Link-format (:rfc:`6690`)

    :param service: Service to convert
    :type service: dict
    """
    host = str(service.host)
    if ':' in host:
        host = '[%s]' % host
    port = str(service.port)
    if port:
        port = ':' + port
    path = getattr(service.properties, 'path', '/')
    if path and path[0] != '/':
        path = '/' + path
    link_str = '<coap://%s%s%s>' % (host, port, path)
    return link_str
