micro/proxy/proxy.go

22 lines
569 B
Go
Raw Permalink Normal View History

// Package proxy is a transparent proxy built on the micro/server
package proxy
2019-06-06 09:50:25 +01:00
2019-06-06 17:49:41 +01:00
import (
"context"
"go.unistack.org/micro/v3/server"
2019-06-06 17:49:41 +01:00
)
// DefaultEndpoint holds default proxy address
var DefaultEndpoint = "localhost:9090"
// Proxy can be used as a proxy server for micro services
2019-06-06 17:49:41 +01:00
type Proxy interface {
// ProcessMessage handles inbound messages
ProcessMessage(context.Context, server.Message) error
// ServeRequest handles inbound requests
2019-06-06 17:58:21 +01:00
ServeRequest(context.Context, server.Request, server.Response) error
2019-12-16 15:18:20 +00:00
// Name of the proxy protocol
String() string
2019-06-06 17:49:41 +01:00
}