<commit_before>package command

import (
	"fmt"
	"strings"

	"github.com/funkygao/gocli"
)

type Verify struct {
	Ui  cli.Ui
	Cmd string
}

func (this *Verify) Run(args []string) (exitCode int) {
	return
}

func (*Verify) Synopsis() string {
	return "Verify pubsub clients synced with lagacy kafka"
}

func (this *Verify) Help() string {
	help := fmt.Sprintf(`
Usage: %s verify [options]

    Verify pubsub clients synced with lagacy kafka

`, this.Cmd)
	return strings.TrimSpace(help)<commit_msg>prepare for gk verify<commit_after>package command

import (
	"flag"
	"fmt"
	"strings"

	"github.com/funkygao/gafka/ctx"
	"github.com/funkygao/gocli"
	"github.com/go-ozzo/ozzo-dbx"
	_ "github.com/go-sql-driver/mysql"
	"github.com/ryanuber/columnize"
)

type Verify struct {
	Ui  cli.Ui
	Cmd string

	zone    string
	cluster string

	mode string
}

func (this *Verify) Run(args []string) (exitCode int) {
	cmdFlags := flag.NewFlagSet("verify", flag.ContinueOnError)
	cmdFlags.Usage = func() { this.Ui.Output(this.Help()) }
	cmdFlags.StringVar(&this.zone, "z", ctx.ZkDefaultZone(), "")
	cmdFlags.StringVar(&this.cluster, "c", "", "")
	cmdFlags.StringVar(&this.mode, "mode", "p", "")
	if err := cmdFlags.Parse(args); err != nil {
		return 1
	}

	lines := make([]string, 0)
	this.Ui.Output(columnize.SimpleFormat(lines))

	return
}

func (this *Verify) loadFromDb() {
	db, err := dbx.Open("mysql", "user:pass@/example")
	swallow(err)

	// create a new query
	q := db.NewQuery("SELECT id, name FROM users LIMIT 10")

	// fetch all rows into a struct array
	var users []struct {
		ID, Name string
	}
	q.All(&users)
}

func (*Verify) Synopsis() string {
	return "Verify pubsub clients synced with lagacy kafka"
}

func (this *Verify) Help() string {
	help := fmt.Sprintf(`
Usage: %s verify [options]

    Verify pubsub clients synced with lagacy kafka

Options:

    -z zone
      Default %s

    -c cluster

    -mode <p|s>


`, this.Cmd, ctx.ZkDefaultZone())
	return strings.TrimSpace(help)
{'fraction_non_alphanumeric': 0.14631685166498487, 'fraction_numerical': 0.0020181634712411706, 'mean_word_length': 3.945137157107232, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4405783', 'n_tokens_mistral': 746, 'n_tokens_neox': 732, 'n_words': 191}