예제 #1
0
파일: cards.go 프로젝트: klauern/trackello
func listCardsOnBoard(cmd *cobra.Command, args []string) {
	token := viper.GetString("token")
	appKey := viper.GetString("appkey")

	conn, err := trackello.NewTrackello(token, appKey)
	if err != nil {
		log.Fatal(err)
		os.Exit(1)
	}
	boardID := viper.GetString("board")
	if len(args) > 0 {
		boardID = args[0]
	}

	if board, err := conn.Board(boardID); err != nil {
		log.Fatal(err)
		os.Exit(1)
	} else {
		if lists, err := board.Lists(); err == nil {
			fmt.Println("Lists: ")
			for _, list := range lists {
				fmt.Printf("* %s\n", list.Name)
				printCards(list)
			}
		} else {
			log.Fatal(err)
			os.Exit(1)
		}
	}
}
예제 #2
0
파일: boards.go 프로젝트: klauern/trackello
func listBoards(cmd *cobra.Command, args []string) {
	token := viper.GetString("token")
	appKey := viper.GetString("appkey")

	trelloConn, err := trackello.NewTrackello(token, appKey)
	if err != nil {
		log.Fatal(err)
		os.Exit(1)
	}
	fmt.Println("Printing all OPEN Boards")
	boards, err := trelloConn.Boards()
	if err != nil {
		log.Fatal(err)
		os.Exit(1)
	}
	fmt.Printf("%-32s\t%-20s\n%-32s\t%-20s\n", "Board Name", "ID", "==========", "==")
	for _, v := range boards {
		if !v.Closed {
			fmt.Printf("%-32s\t%-30s\n", v.Name, v.Id)
		}
	}
}
예제 #3
0
파일: list.go 프로젝트: klauern/trackello
// PrintParallelBoardActivity will take a Board ID and print all of the activity that the board has, by parallelizing
// requests by List.
func PrintParallelBoardActivity(id string) {
	token := viper.GetString("token")
	appKey := viper.GetString("appkey")

	t, err := trackello.NewTrackello(token, appKey)
	if err != nil {
		panic(err)
	}
	b, err := t.Board(id)
	if err != nil {
		panic(err)
	}
	board := trackello.NewBoard(b)
	err = board.PopulateLists()
	if err != nil {
		panic(err)
	}
	err = board.MapActions()
	if err != nil {
		panic(err)
	}

	board.PrintActions()
}