You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/26 07:36:26 UTC

[GitHub] [pulsar-client-go] ericwangdka opened a new issue #334: Unresolved reference 'NewAuthenticationTLS' when compile whit goland

ericwangdka opened a new issue #334:
URL: https://github.com/apache/pulsar-client-go/issues/334


   when  compile with goland it  shows me undefined: NewAuthenticationTLS   ,how can i to do with it.
   
   package main
   
   import (
   	"context"
   	"fmt"
   	"github.com/apache/pulsar-client-go/pulsar"
   	"log"
   )
   
   
   func main() {
   
   	client, err := pulsar.NewClient(pulsar.ClientOptions{
   		URL: "pulsar+ssl://127.0.0.1:6651/",
   		TLSTrustCertsFilePath: "E:\\\\my-ca1\\\\my-ca\\\\certs\\\\ca.cert.pem",
   		Authentication: NewAuthenticationTLS("my-cert.pem", "my-key.pem"),
   	})
   
   	if err != nil {
   		log.Fatal(err)
   	}
   
   	defer client.Close()
   
   	producer, err := client.CreateProducer(pulsar.ProducerOptions{
   		Topic: "persistent://alice/alice-namespace/my-topic1",
   	})
   	if err != nil {
   		log.Fatal(err)
   	}
   
   	defer producer.Close()
   
   	ctx := context.Background()
   
   	for i := 0; i < 10; i++ {
   		if msgId, err := producer.Send(ctx, &pulsar.ProducerMessage{
   			Payload: []byte(fmt.Sprintf("hello-%d", i)),
   		}); err != nil {
   			log.Fatal(err)
   		} else {
   			log.Println("Published message: ", msgId)
   		}
   	}
   }
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #334: Unresolved reference 'NewAuthenticationTLS' when compile whit goland

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #334:
URL: https://github.com/apache/pulsar-client-go/issues/334#issuecomment-664714407


   @ericwangdka I will close this issue first, if there are other issues, please let me know or reopen the issue, thanks.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #334: Unresolved reference 'NewAuthenticationTLS' when compile whit goland

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #334:
URL: https://github.com/apache/pulsar-client-go/issues/334#issuecomment-664086101


   > @wolfstudy Can you take a look at this issue?
   
   Sure
   
   @ericwangdka `NewAuthenticationTLS` is a method under **pulsar** pkg, so you need to add the name of pkg to implement the call, as follows:
   
   
   ```
   	client, err := pulsar.NewClient(pulsar.ClientOptions{
   		URL: "pulsar+ssl://127.0.0.1:6651/",
   		TLSTrustCertsFilePath: "E:\\\\my-ca1\\\\my-ca\\\\certs\\\\ca.cert.pem",
   		Authentication: pulsar.NewAuthenticationTLS("my-cert.pem", "my-key.pem"),
   	})
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] sijie commented on issue #334: Unresolved reference 'NewAuthenticationTLS' when compile whit goland

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #334:
URL: https://github.com/apache/pulsar-client-go/issues/334#issuecomment-664076641


   @wolfstudy Can you take a look at this issue?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy closed issue #334: Unresolved reference 'NewAuthenticationTLS' when compile whit goland

Posted by GitBox <gi...@apache.org>.
wolfstudy closed issue #334:
URL: https://github.com/apache/pulsar-client-go/issues/334


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org