chengxilo commented on code in PR #1916:
URL: https://github.com/apache/iggy/pull/1916#discussion_r2173379084
##########
foreign/go/samples/consumer/consumer.go:
##########
@@ -38,39 +38,32 @@ const (
)
func main() {
- factory := &IggyClientFactory{}
- config := IggyConfiguration{
- BaseAddress: "127.0.0.1:8090",
- Protocol: Tcp,
- }
-
- messageStream, err := factory.CreateMessageStream(config)
+ cli, err :=
iggycli.NewIggyClientBuilder().WithTcp().WithServerAddress("127.0.0.1:8090").Build()
if err != nil {
panic(err)
}
-
- _, err = messageStream.LogIn(LogInRequest{
+ _, err = cli.LoginUser(LoginUserRequest{
Username: "iggy",
Password: "iggy",
})
if err != nil {
panic("COULD NOT LOG IN")
}
- if err = EnsureInsfrastructureIsInitialized(messageStream); err != nil {
+ if err = EnsureInsfrastructureIsInitialized(cli); err != nil {
panic(err)
}
- if err := ConsumeMessages(messageStream); err != nil {
+ if err := ConsumeMessages(*cli); err != nil {
Review Comment:
It's because `func ConsumeMessages(messageStream iggycli.IggyClient) error`
in `foreign/go/samples/consumer/consumer.go` only accept iggycli.IggyClient
instead of *iggycli.IggyClient. I will change this function instead of
dereference later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]