{"modulePath":"github.com/github/git-media","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package commands\n\n## Constants\n\n```go\nconst (\n\tPruneProgressTypeLocal  = PruneProgressType(iota)\n\tPruneProgressTypeRetain = PruneProgressType(iota)\n\tPruneProgressTypeVerify = PruneProgressType(iota)\n)\n```\n\n## Variables\n\n```go\nvar (\n\tDebugging    = false\n\tErrorBuffer  = \u0026bytes.Buffer{}\n\tErrorWriter  = io.MultiWriter(os.Stderr, ErrorBuffer)\n\tOutputWriter = io.MultiWriter(os.Stdout, ErrorBuffer)\n\tManPages     = make(map[string]string, 20)\n)\n```\n\n## Functions\n\n```go\nfunc Cleanup()\n```\n\n```go\nfunc Debug(format string, args ...interface{})\n```\nDebug prints a formatted message if debugging is enabled.  The formatted message also shows up in the panic log, if created.\n\n```go\nfunc Error(format string, args ...interface{})\n```\nError prints a formatted message to Stderr.  It also gets printed to the panic log if one is created for this command.\n\n```go\nfunc Exit(format string, args ...interface{})\n```\nExit prints a formatted message and exits.\n\n```go\nfunc ExitWithError(err error)\n```\nExitWithError either panics with a full stack trace for fatal errors, or simply prints the error message and exits immediately.\n\n```go\nfunc FullError(err error)\n```\nFullError prints either a full stack trace for fatal errors, or just the error message.\n\n```go\nfunc LoggedError(err error, format string, args ...interface{})\n```\nLoggedError prints the given message formatted with its arguments (if any) to Stderr. If an empty string is passed as the \"format\" argument, only the standard error logging message will be printed, and the error's body will be omitted.\n\nIt also writes a stack trace for the error to a log file without exiting.\n\n```go\nfunc NewCommand(name string, runFn func(*cobra.Command, []string)) *cobra.Command\n```\nNewCommand creates a new 'git-lfs' sub command, given a command name and command run function.\n\nEach command will initialize the local storage ('.git/lfs') directory when run, unless the PreRun hook is set to nil.\n\n```go\nfunc Panic(err error, format string, args ...interface{})\n```\nPanic prints a formatted message, and writes a stack trace for the error to a log file before exiting.\n\n```go\nfunc PipeCommand(name string, args ...string) error\n```\n\n```go\nfunc PipeMediaCommand(name string, args ...string) error\n```\n\n```go\nfunc Print(format string, args ...interface{})\n```\nPrint prints a formatted message to Stdout.  It also gets printed to the panic log if one is created for this command.\n\n```go\nfunc RegisterCommand(name string, runFn func(cmd *cobra.Command, args []string), fn func(cmd *cobra.Command))\n```\nRegisterCommand creates a direct 'git-lfs' subcommand, given a command name, a command run function, and an optional callback during the command initialization process.\n\nThe 'git-lfs' command initialization is deferred until the \\`commands.Run()\\` function is called. The fn callback is passed the output from NewCommand, and gives the caller the flexibility to customize the command by adding flags, tweaking command hooks, etc.\n\n```go\nfunc Run() int\n```\nRun initializes the 'git-lfs' command and runs it with the given stdin and command line args.\n\nIt returns an exit code.\n\n## Types\n\n```go\ntype EntriesBySize []*MigrateInfoEntry\n```\nEntriesBySize is an implementation of sort.Interface that sorts a set of \\`\\*MigrateInfoEntry\\`'s\n\n```go\nfunc (e EntriesBySize) Len() int\n```\nLen returns the total length of the set of \\`\\*MigrateInfoEntry\\`'s.\n\n```go\nfunc (e EntriesBySize) Less(i, j int) bool\n```\nLess returns the whether or not the MigrateInfoEntry given at \\`i\\` takes up less total size than the MigrateInfoEntry given at \\`j\\`.\n\n```go\nfunc (e EntriesBySize) Print(to io.Writer) (int, error)\n```\nPrint formats the \\`\\*MigrateInfoEntry\\`'s in the set and prints them to the given io.Writer, \"to\", returning \"n\" the number of bytes written, and any error, if one occurred.\n\n```go\nfunc (e EntriesBySize) Swap(i, j int)\n```\nSwap swaps the entries given at i, j.\n\n```go\ntype JSONStatus struct {\n\tFiles map[string]JSONStatusEntry `json:\"files\"`\n}\n```\n\n```go\ntype JSONStatusEntry struct {\n\tStatus string `json:\"status\"`\n\tFrom   string `json:\"from,omitempty\"`\n}\n```\n\n```go\ntype MigrateInfoEntry struct {\n\t// Qualifier is the filepath's extension.\n\tQualifier string\n\n\t// BytesAbove is total size of all files above a given threshold.\n\tBytesAbove int64\n\t// TotalAbove is the count of all files above a given size threshold.\n\tTotalAbove int64\n\t// BytesTotal is the number of bytes of all files\n\tBytesTotal int64\n\t// Total is the count of all files.\n\tTotal int64\n}\n```\nMigrateInfoEntry represents a tuple of filetype to bytes and entry count above and below a threshold.\n\n```go\nfunc MapToEntries(exts map[string]*MigrateInfoEntry) []*MigrateInfoEntry\n```\nMapToEntries creates a set of \\`\\*MigrateInfoEntry\\`'s for a given map of filepath extensions to file size in bytes.\n\n```go\ntype PruneProgress struct {\n\tProgressType PruneProgressType\n\tCount        int // Number of items done\n}\n```\nProgress from a sub-task of prune\n\n```go\ntype PruneProgressChan chan PruneProgress\n```\n\n```go\ntype PruneProgressType int\n```\n\n","path":"github.com/github/git-media/commands","name":"commands","synopsis":"","isRedistributable":true}
