-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdd93e1
commit d45d175
Showing
30 changed files
with
1,338 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// pkg/mocks/mock_server_stream.go | ||
|
||
package mocks | ||
|
||
import ( | ||
"context" | ||
|
||
"google.golang.org/grpc" | ||
|
||
pb "github.com/hitesh22rana/mq/pkg/proto/mq" | ||
) | ||
|
||
type ServerStreamMock struct { | ||
grpc.ServerStream | ||
ctx context.Context | ||
sentFromServer chan *pb.Message | ||
} | ||
|
||
func NewServerStreamMock(ctx context.Context, len int) *ServerStreamMock { | ||
return &ServerStreamMock{ | ||
ctx: ctx, | ||
sentFromServer: make(chan *pb.Message, len), | ||
} | ||
} | ||
|
||
func (m *ServerStreamMock) Context() context.Context { | ||
return m.ctx | ||
} | ||
|
||
func (m *ServerStreamMock) Send(msg *pb.Message) error { | ||
m.sentFromServer <- msg | ||
return nil | ||
} |
Oops, something went wrong.