mirror of
https://github.com/kataras/iris.git
synced 2025-12-27 14:57:05 +00:00
add Context.ReadJSONProtobuf method
Former-commit-id: 9c7f268c0d7be7e405ea97a5ac12257beba3a4f3
This commit is contained in:
18
_examples/response-writer/protobuf/README.md
Normal file
18
_examples/response-writer/protobuf/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Protocol Buffers
|
||||
|
||||
The `Context.Protobuf(proto.Message)` is the method which sends protos to the client. It accepts a [proto.Message](https://godoc.org/google.golang.org/protobuf/proto#Message) value.
|
||||
|
||||
> Note: Iris is using the newest version of the Go protocol buffers implementation. Read more about it at [The Go Blog: A new Go API for Protocol Buffers](https://blog.golang.org/protobuf-apiv2).
|
||||
|
||||
|
||||
1. Install the protoc-gen-go tool.
|
||||
|
||||
```sh
|
||||
$ go get -u google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
```
|
||||
|
||||
2. Generate proto
|
||||
|
||||
```sh
|
||||
$ protoc -I protos/ protos/hello.proto --go_out=.
|
||||
```
|
||||
Reference in New Issue
Block a user