shop-go

command module
v0.0.0-...-96e820d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2018 License: MIT Imports: 4 Imported by: 0

README

SHOP-GO 还在完善中

WIKI

SHOP 说明介绍地址

SHOP-GO WIKI

https://github.com/foxiswho/shop-go/wiki

ECHO GO SHOP Go (Echo Web)

Go web framework Echo example. RBAC权限,JWT、Socket,session,cookie,缓存,登录,注册,上传,db数据库操作,生成models,service演示

本案例是是 对 echo-web 的增强版,站在巨人的肩膀上

Echo中文文档 go-echo.org

Requires

  • go1.8+
  • Echo V3

启动

https://github.com/foxiswho/shop-go/wiki/90.run

5.子域名
# ./conf/conf.toml
[server]
addr = ":8080"
domain_api = "echo.api.localhost.com"
domain_www = "echo.www.localhost.com"
domain_socket = "echo.socket.localhost.com"

# 改host
$ vi /etc/hosts
127.0.0.1       echo.api.localhost.com
127.0.0.1       echo.www.localhost.com
127.0.0.1       echo.www.localhost.com

# Nginx配置,可选
server{
    listen       80;
    server_name  echo.www.localhost.com echo.api.localhost.com echo.socket.localhost.com;

    charset utf-8;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Confd管理配置

# 安装confd
$ go get github.com/kelseyhightower/confd
# 将配置写入etcd,统一前缀echo-web
$ etcdctl ls --recursive --sort /echo-web
/echo-web/app
/echo-web/app/name
......
/echo-web/tmpl/suffix
/echo-web/tmpl/type

$ cd {pwd}/echo-web
$ confd -onetime -confdir conf  -backend etcd -node http://127.0.0.1:4001 -prefix echo-web

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
consts
dao
middleware
binder
Based on https://github.com/labstack/echo/blob/v1/binder.go
Based on https://github.com/labstack/echo/blob/v1/binder.go
multitemplate
Base on github.com/gin-gonic/contrib/renders/multitemplate
Base on github.com/gin-gonic/contrib/renders/multitemplate
pongo2echo
Base on github.com/robvdl/pongo2gin
Base on github.com/robvdl/pongo2gin
session
Session implements middleware for easily using github.com/gorilla/sessions within echo.
Session implements middleware for easily using github.com/gorilla/sessions within echo.
staticbin
Based on https://github.com/olebedev/staticbin
Based on https://github.com/olebedev/staticbin
module
auth/admin_auth
Base on https://github.com/martini-contrib/sessionauth 这里不能随便自定义,否则,需要改的好多地方,如 模板
Base on https://github.com/martini-contrib/sessionauth 这里不能随便自定义,否则,需要改的好多地方,如 模板
db
jwt
log
web
service
json
Package json implements encoding and decoding of JSON as defined in RFC 4627.
Package json implements encoding and decoding of JSON as defined in RFC 4627.
sql
str

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL