cmd

package
v0.0.0-...-7442f48 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cmd contains the main desprite CLI.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "desprite IMAGE CSS [CSS]...",
	Example: "  desprite sprite.png first.css second.css --verbose",
	Short:   "desprite splits sprite images by CSS usage",
	Args:    cobra.MinimumNArgs(2),
	Run: func(cmd *cobra.Command, args []string) {
		run(args[0], args[1:])
	},
}

RootCmd is the main desprite command.

Functions

This section is empty.

Types

type IOGroup

type IOGroup interface {
	// Limit returns the rate limit for this IOGroup.
	Limit() int

	// Take consumes a rate token and increments the WaitGroup counter.
	// It must be returned with Done().
	Take()

	// Done returns a rate token and decrements the WaitGroup counter.
	Done()

	// Wait blocks until the WaitGroup counter is zero.
	Wait()
}

IOGroup wraps a WaitGroup with an additional rate-limit interface. It is meant for a group of goroutines dealing with file ops.

func NewIOGroup

func NewIOGroup() IOGroup

NewIOGroup creates a best-effort IOGroup. Limit is determined dynamically with syscall, or falls back to a safe value.

Jump to

Keyboard shortcuts

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