populatepost

package
v0.0.0-...-ef87ef9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "populate-post",
	Usage: "Populate post with random comments",
	Flags: []cli.Flag{
		&cli.Int64Flag{
			Name:     "num-comments",
			Usage:    "No of comments",
			Value:    100,
			Required: true,
		},
		&cli.StringFlag{
			Name:     "user",
			Usage:    "Username",
			Required: true,
		},
	},
	Action: func(ctx *cli.Context) error {
		db := ctx.Context.Value("db").(*sql.DB)
		post := ctx.Args().First()
		username := ctx.String("user")
		numComments := ctx.Int("num-comments")
		populatePost(db, post, username, numComments, false)
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL