Git Product home page Git Product logo

cricket's Introduction

cricket 蟋蟀、蛐蛐

公钥、私钥的生成

  1. 生成1024位的公钥 openssl genrsa -out private.pem 1024
  2. 根据公钥生成对应的私钥 openssl rsa -in private.pem -pubout -out public.pem

1024不够安全,可以用2048

govendor 依赖管理

  1. 初始化 govendor init
  2. 获取特定版本的依赖 govendor fetch github.com/dgrijalva/[email protected] govendor fetch github.com/astaxie/beego/[email protected] govendor fetch github.com/lib/[email protected] govendor fetch github.com/go-redis/[email protected] govendor fetch github.com/gin-gonic/[email protected]

运行

  1. 最low的运行方式: go run main.go models.go
  2. 运行package(相对于$GOPATH或$GOROOT): go run github.com\kotocean\cricket\auth
  3. 测试:cd auth/db && go test -v

启动postgresql

docker run --name postgresql -p 5432:5432 -e POSTGRESQL_USERNAME=my_user -e POSTGRESQL_PASSWORD=password123 -e POSTGRESQL_DATABASE=cricket_db bitnami/postgresql:10

  1. 登录 psql cricket_db my_user
  2. 创建person表
create table person (
id serial,
name varchar(20),
password varchar(20)
);
  1. 创建record表
create table record (
id serial,
client_mark varchar(320),
token varchar(320),
expires_at bigint,
valid boolean
);
  1. 创建client表
create table client (
id serial,
client_id varchar(20),
secret varchar(128)
);

启动redis

docker run --name redis -d -p 6379:6379 redis:alpine3.8 默认没有密码,localhost登录

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.