zoukankan      html  css  js  c++  java
  • EasyNVR及EasyRTC平台使用Go语言项目管理GoVendor和gomod的使用总结

    TSINGSEE青犀视频云边端架构体系的产品中,流媒体平台均是使用Go语言开发,因为遗留代码的问题,EasyNVR、EasyDSS等平台需要使用govendor进行代码的项目管理,而EasyRTC 等新项目则是采用gomod进行开发。以下是我们在开发平台过程中,对两者的使用进行的总结,现与大家分享下。

    GoVendor的基本使用如下:

    govendor init 初始化项目
    govendor fetch 增加依赖
    govendor remove 删除包依赖
    govendor update 更新包依赖
    govendor list 列出包
    govendor stat 查看包是否过期
    ./vendor/vendor.json 依赖包
    govendor --help

    gomod 的使用如下:

    go mod download    下载依赖的module到本地cache(默认为$GOPATH/pkg/mod目录)
    go mod edit        编辑go.mod文件
        go mod edit -fmt 格式化
        go mod edit -require=golang.org/x/text 添加依赖项
        go mod edit -droprequire=golang.org/x/text 移除依赖项
    go mod graph       打印模块依赖图
    go mod init        初始化当前文件夹, 创建go.mod文件
    go mod tidy        增加缺少的module,删除无用的module
    go mod vendor      将依赖复制到vendor下
    go mod verify      校验依赖
    go mod why         解释为什么需要依赖
    go.mod 依赖包
    gp.sum 依赖包
    go get -u /sadas/asfasdfdsa 更新依赖

     gomod 为官方推荐的项目管理工具,随着go1.16的出现,建议所有的项目都采用 gomod 进行项目管理。因为部分网站无法访问的问题,因此在使用时添加以下配置可以解决该问题:

    GOPROXY=https://goproxy.cn,direct;GONOSUMDB=gitlab.com,gitee.com;GONOPROXY=gitlab.com,gitee.com

    EasyNVR、EasyDSS都已经是成熟稳定的视频流媒体平台,可以直接下载测试,EasyRTC的重制版还正在开发当中,其架构有了新的方向,在不久之后新的版本也会上线和大家见面,TSINGSEE青犀视频云边端架构全平台都欢迎大家测试和了解。

  • 相关阅读:
    双11专刊|云原生数据仓库AnalyticDB支撑双11,大幅提升分析实时性和用户体验
    LeetCode_Binary Tree Inorder Traversal
    LeetCode_4Sum
    LeetCode_Add Binary
    LeetCode_Add Two Numbers
    LeetCode_3Sum Closest
    Building CEGUI with Ogre 1.8.1
    LeetCode_3Sum
    LeetCode_Climbing Stairs
    LeetCode_Binary Tree Level Order Traversal
  • 原文地址:https://www.cnblogs.com/TSINGSEE/p/14918509.html
Copyright © 2011-2022 走看看