mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
refactor grpc proxy backends to use machine management IP in metadata, including local responses
This commit is contained in:
@@ -20,11 +20,13 @@ type LocalBackend struct {
|
||||
|
||||
var _ proxy.Backend = (*LocalBackend)(nil)
|
||||
|
||||
// NewLocalBackend returns a new LocalBackend for the given Unix socket path.
|
||||
func NewLocalBackend(sockPath string) *LocalBackend {
|
||||
// NewLocalBackend returns a new LocalBackend for the given Unix socket path. The addr parameter is the local address
|
||||
// of the current machine which could be empty if it's not known. The address is used to populate response metadata
|
||||
// in one2many mode.
|
||||
func NewLocalBackend(sockPath, addr string) *LocalBackend {
|
||||
return &LocalBackend{
|
||||
One2ManyResponder: One2ManyResponder{
|
||||
machine: "local",
|
||||
machine: addr,
|
||||
},
|
||||
sockPath: sockPath,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user