thriftpy_utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:babeltrace-zipkin 作者: vears91 项目源码 文件源码
def create_endpoint(ipv4, port, service_name):
    """Creates an endpoint object

    :param ipv4: ipv4 address of the endpoint
    :param port: port of the endpoint
    :service_name: human readable name that identifies the service of the endpoint
    :returns: zipkin endpoint object
    """

    if (ipv4 == ""):
        ipv4 = "0.0.0.0"
    try:
        ipv4 = int(ipaddress.IPv4Address(ipv4))
    except:
        ipv4 = "0.0.0.0"
    port = int(port)

    return zipkin_core.Endpoint(
        ipv4=ipv4, port=port, service_name=service_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号