Code Monkey home page Code Monkey logo

wepay's Introduction

wepay——微信支付gosdk

根据微信支付官方文档开发的go程序,提供支持普通商户微信支付的功能

  1. 使用go语言开发微信支付相关接口 微信支付文档

  2. 使用echo框架开发restful API echo简介

  3. 使用mongodb存储数据 mgo驱动官网

  4. 使用dep进行包管理 dep包管理工具

  5. 项目结构

     wepay/  
     |---main.go    main函数 
     |---config.go  配置函数 初始化配置文件
     |---router.go  路由函数 提供api
     |---db.go      数据函数 提供数据库连接
     |---.gitignore git忽略文件 
     |---.env       env配置文件 提供config.go读取的配置文件
     |---Dockerfile dockerfile 构建docker镜像
    
  6. 使用到的第三方库

    echo : 一款go写的高效的web框架 https://github.com/labstack/echo

    godotenv : 一个go写的读取.env文件的库 https://github.com/joho/godotenv

    logrus : 一个go写的高效的日志库 https://github.com/sirupsen/logrus

    multiconfig : 一个go写的多重载入配置文件的库 https://github.com/koding/multiconfig

    mgo : 一个mongodb的go语言的驱动 https://labix.org/mgo

  7. 由于使用的包有被GFW墙掉的,所以我没有ignore掉vendor文件夹

Tips

打包成可执行程序并压缩
1.使用go build -ldflags '-w -s'进行代码编译,得到.exe文件
2.使用upx小工具进行压缩,使得.exe文件大幅度缩小 upx官网

wepay's People

Contributors

alphayan avatar

Watchers

zan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.