2020-11-23 16:18:47 +03:00
|
|
|
// Package proxy is a transparent proxy built on the micro/server
|
2023-04-11 22:20:37 +03:00
|
|
|
package proxy // import "go.unistack.org/micro/v4/proxy"
|
2019-06-06 11:50:25 +03:00
|
|
|
|
2019-06-06 19:49:41 +03:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-04-11 22:20:37 +03:00
|
|
|
"go.unistack.org/micro/v4/server"
|
2019-06-06 19:49:41 +03:00
|
|
|
)
|
|
|
|
|
2021-04-27 08:32:47 +03:00
|
|
|
// DefaultEndpoint holds default proxy address
|
|
|
|
var DefaultEndpoint = "localhost:9090"
|
2021-02-14 16:16:01 +03:00
|
|
|
|
2020-11-23 16:18:47 +03:00
|
|
|
// Proxy can be used as a proxy server for micro services
|
2019-06-06 19:49:41 +03:00
|
|
|
type Proxy interface {
|
2019-11-25 19:31:43 +03:00
|
|
|
// ProcessMessage handles inbound messages
|
|
|
|
ProcessMessage(context.Context, server.Message) error
|
|
|
|
// ServeRequest handles inbound requests
|
2019-06-06 19:58:21 +03:00
|
|
|
ServeRequest(context.Context, server.Request, server.Response) error
|
2019-12-16 18:18:20 +03:00
|
|
|
// Name of the proxy protocol
|
|
|
|
String() string
|
2019-06-06 19:49:41 +03:00
|
|
|
}
|