V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
工单节点使用指南
• 请用平和的语言准确描述你所遇到的问题
• 厂商的技术支持和你一样也是有喜怒哀乐的普通人类,尊重是相互的
• 如果是关于 V2EX 本身的问题反馈,请使用 反馈 节点
xiaoyanbot

百度网盘开放平台 API 这里给了个 go 的 sdk 的例子,但是里面引入了个 icode.baidu.com/baidu/xpan/go-sdk/xpan/utils 请教这个库怎么找到?

  •  
  •   xiaoyanbot · Jun 4, 2022 · 2093 views
    This topic created in 1424 days ago, the information mentioned may be changed or developed.

    sdk 例子是从这里下载的: https://pan.baidu.com/union/doc/Fksg0sbcm#sdk%E8%8E%B7%E5%8F%96

    在 file_metas.go ,import 引入了 [ icode.baidu.com/baidu/xpan/go-sdk/xpan/utils ]

    尝试了直接访问这个全限定名网址,go get ,go install ,各类搜索,翻找他们文档等方式,还是没找到

    请教帮忙看看, 这个 sdk 的例子是不是运行不起来?

    10 replies    2022-06-04 21:54:23 +08:00
    xiaoyanbot
        1
    xiaoyanbot  
    OP
       Jun 4, 2022
    其他文档还引入了类似 ["icode.baidu.com/baidu/xpan/go-sdk/xpan/fileinfo"] 也是没找到
    acehowxx
        2
    acehowxx  
       Jun 4, 2022 via Android
    go mod tidy 试试
    xiaoyanbot
        3
    xiaoyanbot  
    OP
       Jun 4, 2022
    @acehowxx 没有 go mod 文件
    ZeoKarl
        4
    ZeoKarl  
       Jun 4, 2022
    我估摸着应该是百度内网的东西.
    acehowxx
        5
    acehowxx  
       Jun 4, 2022 via Android
    @xiaoyanbot 没有你不会 go mod init test 出来一个吗?没用过 go mod??
    unifier
        6
    unifier  
       Jun 4, 2022
    icode 应该是百度内部的代码平台吧,估计是发出来之前没仔细修改

    用关键字去 github 搜了一下,参考一下这个试试,https://github.com/jsyzchen/pan
    xiaoyanbot
        7
    xiaoyanbot  
    OP
       Jun 4, 2022
    @zacharyjia 这个仓库, 我搜到了。 不是这个文档里提到的库
    xiaoyanbot
        8
    xiaoyanbot  
    OP
       Jun 4, 2022
    @acehowxx 会用的。 是找不到里面的这个库: 提示是这个样子的:

    ~~~

    go mod tidy
    go: finding module for package icode.baidu.com/baidu/xpan/go-sdk/xpan/download
    go: finding module for package icode.baidu.com/baidu/xpan/go-sdk/xpan/utils


    icode.baidu.com/baidu/xpan/go-sdk/xpan/utils: module icode.baidu.com/baidu/xpan/go-sdk/xpan/utils: Get "https://proxy.golang.org/icode.baidu.com/baidu/xpan/go-sdk/xpan/utils/@v/list": dial tcp 142.251.43.17:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.


    icode.baidu.com/baidu/xpan/go-sdk/xpan/download: module icode.baidu.com/baidu/xpan/go-sdk/xpan/download: Get "https://proxy.golang.org/icode.baidu.com/baidu/xpan/go-sdk/xpan/download/@v/list": dial tcp 142.251.43.17:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

    ~~~
    acehowxx
        9
    acehowxx  
       Jun 4, 2022 via Android
    @xiaoyanbot 你设 goproxy 没有,墙内拉 golang.org 的东西直接拉不下来。你这错误提示就是超时了拉不下来。要不就挂全局代理,要不就得设 goproxy 环境变量。
    kirile
        10
    kirile  
       Jun 4, 2022
    ping 一下 这个域名就能看到是个内网 ip. @xiaoyanbot
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3749 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 363ms · UTC 10:38 · PVG 18:38 · LAX 03:38 · JFK 06:38
    ♥ Do have faith in what you're doing.