file

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: 12 Imported by: 0

README

File

本篇演示micro中的大文件传输(流式调用)。

内容

  • server.go - 文件接收服务端
  • client.go - 文件发送客户端

运行File

使用protoc生成相应的代码

protoc --go_out=. --micro_out=. proto/file.proto

运行服务端

go run server.go

运行客户端

go run client.go

使用

使用Postman/CURL向http://127.0.0.1:8080/upload发送文件

curl http://127.0.0.1:8080/upload -F "file=@go.sum"

得到一串md5

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