1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-11-29 21:47:44 +02:00
Files
go-micro/internal/website/docs/transport.md

41 lines
673 B
Markdown
Raw Normal View History

---
layout: default
---
# Transport
The transport layer is responsible for communication between services.
## Features
- Pluggable transport implementations
- Secure and efficient communication
## Implementations
Supported transports include:
- TCP (default)
- gRPC
You can specify the transport when initializing your service.
## Example Usage
Here's how to use a custom transport (e.g., gRPC) in your Go Micro service:
```go
package main
import (
"go-micro.dev/v5"
"go-micro.dev/v5/transport/grpc"
)
func main() {
t := grpc.NewTransport()
service := micro.NewService(
micro.Transport(t),
)
service.Init()
service.Run()
}
```