with-api

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: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

API

我们在这里演示通过micro api调用有wrapper包装的接口

我们演示两个包装器:

  • logWrapper
  • rspHeaderWrapper

使用方式

运行API网关,我们传入api指令运行:

micro api --handler=api

再运行本api服务

go run api.go

调用服务

通过URL /example/call,就会调用go.micro.api.example服务的Example.Call接口

请求头的数据会被传到最终调用的接口

curl -H 'head-1: I am a header' "http://localhost:8080/example/call?name=john"

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