consul/agent/grpc-external/testutils/mock_server_transport_stream.go
Tauhid Anjum 5d294b26d3
NET-5824 Exported services api (#20015)
* Exported services api implemented

* Tests added, refactored code

* Adding server tests

* changelog added

* Proto gen added

* Adding codegen changes

* changing url, response object

* Fixing lint error by having namespace and partition directly

* Tests changes

* refactoring tests

* Simplified uniqueness logic for exported services, sorted the response in order of service name

* Fix lint errors, refactored code
2024-01-23 10:06:59 +05:30

28 lines
547 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package testutils
import "google.golang.org/grpc/metadata"
type MockServerTransportStream struct {
MD metadata.MD
}
func (m *MockServerTransportStream) Method() string {
return ""
}
func (m *MockServerTransportStream) SetHeader(md metadata.MD) error {
return nil
}
func (m *MockServerTransportStream) SendHeader(md metadata.MD) error {
m.MD = metadata.Join(m.MD, md)
return nil
}
func (m *MockServerTransportStream) SetTrailer(md metadata.MD) error {
return nil
}