Skip to content

Commit 7df0167

Browse files
committed
Add exported function comments
1 parent 934c0eb commit 7df0167

6 files changed

Lines changed: 13 additions & 1 deletion

File tree

command/command.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import (
99
"github.com/urfave/cli"
1010
)
1111

12+
// Command holds data for the cli commands.
1213
type Command struct{}
1314

15+
// GetLogger returns a logrus object according to any flags set
16+
// in the application parameters.
1417
func (c Command) GetLogger(cli *cli.Context) *log.Logger {
1518
if cli.GlobalBool("quiet") {
1619
logger, _ := test.NewNullLogger()
@@ -33,6 +36,7 @@ func (c Command) GetLogger(cli *cli.Context) *log.Logger {
3336
return log.StandardLogger()
3437
}
3538

39+
// GetBeanstalkdClient returns a client object for interacting with a beanstalkd server.
3640
func (c Command) GetBeanstalkdClient(cli *cli.Context) (*beanstalkd.BeanstalkdClient, error) {
3741
// Build a connection string.
3842
addr := fmt.Sprintf("%s:%d", cli.GlobalString("server"), cli.GlobalInt("port"))

command/flush.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/urfave/cli"
66
)
77

8+
// Flush empties an entire tube of jobs.
89
func (c *Command) Flush(cli *cli.Context) {
910
log := c.GetLogger(cli)
1011

command/monitor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package command
33
import (
44
"bytes"
55
"fmt"
6-
"github.com/urfave/cli"
76
"time"
7+
8+
"github.com/urfave/cli"
89
)
910

1011
var (
@@ -24,6 +25,7 @@ var (
2425
}
2526
)
2627

28+
// Monitor outputs a overview of server and tube statistics, repeated every second.
2729
func (c *Command) Monitor(cli *cli.Context) {
2830
log := c.GetLogger(cli)
2931

command/peek.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package command
22

33
import (
44
"fmt"
5+
56
"github.com/urfave/cli"
67
)
78

9+
// Peek displays the next job in the tube without removing it.
810
func (c *Command) Peek(cli *cli.Context) {
911
log := c.GetLogger(cli)
1012

command/pop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package command
22

33
import (
44
"fmt"
5+
56
"github.com/sirupsen/logrus"
67
"github.com/urfave/cli"
78
)
89

10+
// Pop removes and displays a job from the selected tube.
911
func (c *Command) Pop(cli *cli.Context) {
1012
log := c.GetLogger(cli)
1113

command/put.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/urfave/cli"
99
)
1010

11+
// Put adds a new job into a queue, from a string or reading from stdin.
1112
func (c *Command) Put(cli *cli.Context) {
1213
log := c.GetLogger(cli)
1314

0 commit comments

Comments
 (0)