Created
May 23, 2018 16:22
-
-
Save monirz/0e13332ade48328bfa4f3a3c339480f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"log" | |
"github.com/tinode/chat/pbx" | |
"google.golang.org/grpc" | |
) | |
type Plugin struct { | |
} | |
type Node struct { | |
} | |
func main() { | |
var conn *grpc.ClientConn | |
conn, err := grpc.Dial(":6061", grpc.WithInsecure()) | |
if err != nil { | |
log.Fatalf("did not connect: %s", err) | |
} | |
plugin := pbx.AccessMode{} | |
log.Println(plugin) | |
defer conn.Close() | |
// c := Plugin{} | |
c := pbx.NewNodeClient(conn) | |
// stream := pbx.SubscriptionEvent{} | |
response, err := c.MessageLoop(context.Background()) | |
if err != nil { | |
log.Fatalf("Error calling : %s", err) | |
} | |
log.Printf("Response from server: %v", response) | |
} | |
// func (n *Node) MessageLoop(stream pbx.ClientMsg) pbx.ServerMsg { | |
// // stream.Message = "hi" | |
// return pbx.ServerMsg{} | |
// } | |
func (p *Plugin) Subscription(subEvent pbx.SubscriptionEvent) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment