cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HighSeverity = iota
	NormalSeverity
	LowSeverity
	DefaultTube = "default"
)

Variables

View Source
var HighSeverityStyle = gocolorize.NewColor("white:red")
View Source
var InfoStyle = gocolorize.NewColor("yellow")
View Source
var NormalSeverityStyle = gocolorize.NewColor("green")
View Source
var TitleStyle = gocolorize.NewColor("green")
View Source
var TooManyErrorsError = errors.New("Too many errors")
View Source
var TubeStatsRetrievalError = errors.New("Unable to retrieve tube stats")

Functions

This section is empty.

Types

type BuryCommand added in v0.1.0

type BuryCommand struct {
	Tube string `short:"t" long:"tube" description:"tube to bury jobs in." required:"true"`
	Num  int    `short:"" long:"num" description:"number of jobs to bury."`
	Command
}

func (*BuryCommand) Bury added in v0.1.0

func (c *BuryCommand) Bury() error

func (*BuryCommand) Execute added in v0.1.0

func (c *BuryCommand) Execute(args []string) error

type Command added in v0.1.0

type Command struct {
	Host string `short:"h" long:"host" description:"beanstalkd host addr." required:"true" default:"localhost:11300"`
	// contains filtered or unexported fields
}

func (*Command) GetStatsForTube added in v0.1.0

func (c *Command) GetStatsForTube(tube string) (*TubeStats, error)

func (*Command) Init added in v0.1.0

func (c *Command) Init() error

func (*Command) PrintJob added in v0.1.0

func (c *Command) PrintJob(id uint64, body []byte) error

type DeleteCommand added in v0.2.0

type DeleteCommand struct {
	Tube  string `short:"t" long:"tube" description:"tube to be delete." required:"true"`
	State string `short:"" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"`
	Print bool   `short:"" long:"print" description:"prints the jobs after delete it." default:"true"`
	Empty bool   `short:"" long:"empty" description:"delete all jobs with the given status in the given tube." default:"false"`
	Command
}

func (*DeleteCommand) Delete added in v0.2.0

func (c *DeleteCommand) Delete() error

func (*DeleteCommand) Execute added in v0.2.0

func (c *DeleteCommand) Execute(args []string) error

type KickCommand added in v0.1.0

type KickCommand struct {
	Tube string `short:"t" long:"tube" description:"tube to kick jobs in." required:"true"`
	Num  int    `short:"" long:"num" description:"number of jobs to kick."`
	Command
}

func (*KickCommand) Execute added in v0.1.0

func (c *KickCommand) Execute(args []string) error

func (*KickCommand) Kick added in v0.1.0

func (c *KickCommand) Kick() error

type PeekCommand added in v0.1.0

type PeekCommand struct {
	Tube  string `short:"t" long:"tube" description:"tube to be tailed." required:"true"`
	State string `short:"" long:"state" description:"peek from 'buried', 'ready' or 'delayed' queues." default:"buried"`
	Command
}

func (*PeekCommand) Execute added in v0.1.0

func (c *PeekCommand) Execute(args []string) error

func (*PeekCommand) Peek added in v0.1.0

func (c *PeekCommand) Peek() error

type PutCommand added in v0.1.0

type PutCommand struct {
	Tube     string        `short:"t" long:"tube" description:"tube to be tailed." required:"true"`
	Body     string        `short:"b" long:"body" description:"plain text data for the job." required:"true"`
	Priority uint32        `short:"" long:"priority" description:"priority for the job." default:"1024"`
	Delay    time.Duration `short:"" long:"delay" description:"delay for the job." default:"0"`
	TTR      time.Duration `short:"" long:"ttr" description:"TTR for the job." default:"60"`

	Command
}

func (*PutCommand) Execute added in v0.1.0

func (c *PutCommand) Execute(args []string) error

func (*PutCommand) Put added in v0.1.0

func (c *PutCommand) Put() error

type StatsCommand added in v0.1.0

type StatsCommand struct {
	Tubes string `short:"t" long:"tubes" description:"tubes to be listed (separated by ,). By default all are listed"`

	Command
}

func (*StatsCommand) Execute added in v0.1.0

func (c *StatsCommand) Execute(args []string) error

func (*StatsCommand) GetStats added in v0.1.0

func (c *StatsCommand) GetStats() (map[string]*TubeStats, error)

func (*StatsCommand) PrintStats added in v0.1.0

func (c *StatsCommand) PrintStats() error

type TailCommand added in v0.1.0

type TailCommand struct {
	Tube   string `short:"t" long:"tube" description:"tube to be tailed." required:"true"`
	Action string `short:"" long:"action" description:"action to perform after reserver the job. (release, bury, delete)" default:"release"`

	Command
}

func (*TailCommand) Execute added in v0.1.0

func (c *TailCommand) Execute(args []string) error

func (*TailCommand) Tail added in v0.1.0

func (c *TailCommand) Tail() error

type TubeStats

type TubeStats struct {
	JobsBuried   int
	JobsDelayed  int
	JobsReady    int
	JobsReserved int
	JobsUrgent   int
	Waiting      int
	TotalJobs    int
}

Jump to

Keyboard shortcuts

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