File: subjects.go

package info (click to toggle)
golang-github-lensesio-schema-registry 0.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: makefile: 4
file content (29 lines) | stat: -rw-r--r-- 474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package cmd

import (
	"fmt"
	"log"

	"github.com/spf13/cobra"
)

var subjectsCmd = &cobra.Command{
	Use:   "subjects",
	Short: "lists all registered subjects",
	Long:  ``,
	RunE: func(cmd *cobra.Command, args []string) error {
		subs, err := assertClient().Subjects()
		if err != nil {
			return err
		}
		log.Printf("there are %d subjects\n", len(subs))
		for _, s := range subs {
			fmt.Println(s)
		}
		return nil
	},
}

func init() {
	RootCmd.AddCommand(subjectsCmd)
}