role

command
v0.0.0-...-8e1814b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

测试运行

服务发现

所有服务都需要服务发现。默认为多播DNS,简单不需要任何配置。

如果您需要多主机或更具弹性可以使用 Consul。

# install
$ brew install consul

# run http://localhost:8500
$ consul agent -dev

运行 srv role

# run srv role
$ cd $GOPATH/src/github.com/idoall/MicroService-UserPowerManager/srv/role
$ go run main.go init.go --registry=consul

运行 api role

$ cd $GOPATH/src/github.com/idoall/MicroService-UserPowerManager/api/role
$ go run main.go init.go --registry=consul

运行 micro api

$ micro --registry=consul api --address=:8080  --handler=api 

测试方法

# Post 方法,添加栏目
$ curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'User=123abc' \
      --url http://localhost:8080/mshk/api/v1/role/Role/deletePermissionsForUser
{"id":"go.micro.api.mshk.api.v1","code":500,"detail":"ParentID 的格式不正确:unable to parse as int: string","status":"Internal Server Error"}

# Get 方法,获取列表
$ curl "http://localhost:8080/mshk/api/v1/role/Role/getPermissionsForUser?User=lion"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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