Unit debug tool
This commit is contained in:
		
							parent
							
								
									d88b952e9d
								
							
						
					
					
						commit
						1b9721825d
					
				| @ -1,16 +0,0 @@ | ||||
| package main | ||||
| 
 | ||||
| import ( | ||||
| 	"fmt" | ||||
| 
 | ||||
| 	"github.com/localhots/yeast/unit" | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
| 	u := unit.New("uuid") | ||||
| 	msg := []byte("{}") | ||||
| 
 | ||||
| 	fmt.Println("Sending message:", string(msg)) | ||||
| 	resp, _ := u.Send(msg) | ||||
| 	fmt.Println("Reply recieved:", string(resp)) | ||||
| } | ||||
							
								
								
									
										25
									
								
								unit_send.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								unit_send.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | ||||
| package main | ||||
| 
 | ||||
| import ( | ||||
| 	"flag" | ||||
| 	"fmt" | ||||
| 
 | ||||
| 	"github.com/localhots/yeast/unit" | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
| 	var ( | ||||
| 		name string | ||||
| 		msg  string | ||||
| 	) | ||||
| 
 | ||||
| 	flag.StringVar(&name, "unit", "", "Unit name") | ||||
| 	flag.StringVar(&msg, "msg", "", "Message") | ||||
| 	flag.Parse() | ||||
| 
 | ||||
| 	u := unit.New(name) | ||||
| 
 | ||||
| 	fmt.Println("Sending message:", msg) | ||||
| 	resp, _ := u.Call([]byte(msg)) | ||||
| 	fmt.Println("Reply recieved:", string(resp)) | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user