Exemplo n.º 1
0
func (i *Invocation) ShowCategories() error {
	var c *client.Client
	var res *rpcpb.GetCategoryResponse

	// Run it on files
	c, _, cleanup, err := i.startServices()
	defer cleanup()
	if err != nil {
		return fmt.Errorf("HTTP client did not become healthy: %v", err)
	}
	glog.Infof("Calling to get the categories")
	err = c.Call("/ShipshapeService/GetCategory", &rpcpb.GetCategoryRequest{}, &res)
	if err != nil {
		fmt.Errorf("Could not get categories: %v", err)
		return err
	}

	fmt.Println(strings.Join(res.Category, "\n"))
	return nil
}