cmd/stream.go
changeset 47 82d8b6074309
parent 45 b58a7ea1aeb2
child 74 78e1c63e4bbe
equal deleted inserted replaced
46:13717ea83333 47:82d8b6074309
     5 
     5 
     6 package cmd
     6 package cmd
     7 
     7 
     8 import (
     8 import (
     9 	"io"
     9 	"io"
       
    10 	"os"
    10 
    11 
    11 	"github.com/pkg/errors"
    12 	"github.com/pkg/errors"
    12 	"github.com/spf13/cobra"
    13 	"github.com/spf13/cobra"
    13 
    14 
    14 	"github.com/McKael/madon"
    15 	"github.com/McKael/madon"
    82 
    83 
    83 	// StreamListener(name string, hashTag string, events chan<- madon.StreamEvent, stopCh <-chan bool, doneCh chan<- bool) error
    84 	// StreamListener(name string, hashTag string, events chan<- madon.StreamEvent, stopCh <-chan bool, doneCh chan<- bool) error
    84 	err := gClient.StreamListener(streamName, tag, evChan, stop, done)
    85 	err := gClient.StreamListener(streamName, tag, evChan, stop, done)
    85 	if err != nil {
    86 	if err != nil {
    86 		errPrint("Error: %s", err.Error())
    87 		errPrint("Error: %s", err.Error())
    87 		return nil
    88 		os.Exit(1)
    88 	}
    89 	}
    89 
    90 
    90 	p, err := getPrinter()
    91 	p, err := getPrinter()
    91 	if err != nil {
    92 	if err != nil {
    92 		close(stop)
    93 		close(stop)