event

command
v0.0.0-...-908d554 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

Event

本篇演示如何使用Event模式下的Micro API,以下简称API

API会把http请求映射到匹配的事件处理服务上

运行

因为我们在代码中声明了事件主题topic是go.micro.evt.user,即是说事件服务的命名所属空间是go.micro.evt,所以我们的API也要是这个命名空间,这样API才能找到它。

micro api --handler=event --namespace=go.micro.evt

运行服务

go run main.go

发送事件

curl -d '{"message": "Hello, Micro中国"}' http://localhost:8080/user/login

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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