{"modulePath":"github.com/github/git-lfs","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tasklog\n\n## Constants\n\n```go\nconst (\n\tDefaultLoggingThrottle = 200 * time.Millisecond\n)\n```\n\n## Types\n\n```go\ntype ListTask struct {\n\t// contains filtered or unexported fields\n}\n```\nListTask is a Task implementation that logs all updates in a list where each entry is line-delimited.\n\nFor example:\n\n\tentry #1\n\tentry #2\n\tmsg: ..., done\n\n```go\nfunc NewListTask(msg string) *ListTask\n```\nNewListTask instantiates a new \\*ListTask instance with the given message.\n\n```go\nfunc (l *ListTask) Complete()\n```\n\n```go\nfunc (l *ListTask) Entry(update string)\n```\nEntry logs a line-delimited task entry.\n\n```go\nfunc (l *ListTask) Throttled() bool\n```\nThrottled implements the Task.Throttled function and ensures that all log updates are printed to the sink.\n\n```go\nfunc (l *ListTask) Updates() \u003c-chan *Update\n```\nUpdates implements the Task.Updates function and returns a channel of updates to log to the sink.\n\n```go\ntype Logger struct {\n\t// contains filtered or unexported fields\n}\n```\nLogger logs a series of tasks to an io.Writer, processing each task in order until completion .\n\n```go\nfunc NewLogger(sink io.Writer) *Logger\n```\nNewLogger retuns a new \\*Logger instance that logs to \"sink\" and uses the current terminal width as the width of the line.\n\n```go\nfunc (l *Logger) Close()\n```\nClose closes the queue and does not allow new Tasks to be \\`enqueue()\\`'d. It waits until the currently running Task has completed.\n\n```go\nfunc (l *Logger) Enqueue(ts ...Task)\n```\nEnqueue enqueues the given Tasks \"ts\".\n\n```go\nfunc (l *Logger) List(msg string) *ListTask\n```\nList creates and enqueues a new \\*ListTask.\n\n```go\nfunc (l *Logger) Percentage(msg string, total uint64) *PercentageTask\n```\nPercentage creates and enqueues a new \\*PercentageTask.\n\n```go\nfunc (l *Logger) Simple() *SimpleTask\n```\nList creates and enqueues a new \\*SimpleTask.\n\n```go\nfunc (l *Logger) Waiter(msg string) *WaitingTask\n```\nWaitier creates and enqueues a new \\*WaitingTask.\n\n```go\ntype PercentageTask struct {\n\t// contains filtered or unexported fields\n}\n```\nPercentageTask is a task that is performed against a known number of elements.\n\n```go\nfunc NewPercentageTask(msg string, total uint64) *PercentageTask\n```\n\n```go\nfunc (c *PercentageTask) Count(n uint64) (new uint64)\n```\nCount indicates that work has been completed against \"n\" number of elements, marking the task as complete if the total \"n\" given to all invocations of this method is equal to total.\n\nCount returns the new total number of (atomically managed) elements that have been completed.\n\n```go\nfunc (t *PercentageTask) Entry(update string)\n```\nEntry logs a line-delimited task entry.\n\n```go\nfunc (c *PercentageTask) Throttled() bool\n```\nThrottled implements Task.Throttled and returns true, indicating that this task is throttled.\n\n```go\nfunc (c *PercentageTask) Updates() \u003c-chan *Update\n```\nUpdates implements Task.Updates and returns a channel which is written to when the state of this task changes, and closed when the task is completed. has been completed.\n\n```go\ntype SimpleTask struct {\n\t// contains filtered or unexported fields\n}\n```\nSimpleTask is in an implementation of tasklog.Task which prints out messages verbatim.\n\n```go\nfunc NewSimpleTask() *SimpleTask\n```\nNewSimpleTask returns a new \\*SimpleTask instance.\n\n```go\nfunc (s *SimpleTask) Complete()\n```\nComplete notes that the task is completed by closing the Updates channel and yields the logger to the next Task. Complete blocks until the \\*tasklog.Logger has acknowledged completion of this task.\n\n```go\nfunc (s *SimpleTask) Log(str string)\n```\nLog logs a string with no formatting verbs.\n\n```go\nfunc (s *SimpleTask) Logf(str string, vals ...interface{})\n```\nLogf logs some formatted string, which is interpreted according to the rules defined in package \"fmt\".\n\n```go\nfunc (s *SimpleTask) OnComplete()\n```\nOnComplete implements an interface which receives a call to this method when the \\*tasklog.Logger has finished processing this task, but before it has accepted new tasks.\n\n```go\nfunc (s *SimpleTask) Throttled() bool\n```\nThrottled implements Task.Throttled and returns false, indicating that this task is not throttled.\n\n```go\nfunc (s *SimpleTask) Updates() \u003c-chan *Update\n```\nUpdates implements Task.Updates and returns a channel of updates which is closed when Complete() is called.\n\n```go\ntype Task interface {\n\t// Updates returns a channel which is written to with the current state\n\t// of the Task when an update is present. It is closed when the task is\n\t// complete.\n\tUpdates() \u003c-chan *Update\n\n\t// Throttled returns whether or not updates from this task should be\n\t// limited when being printed to a sink via *log.Logger.\n\t//\n\t// It is expected to return the same value for a given Task instance.\n\tThrottled() bool\n}\n```\nTask is an interface which encapsulates an activity which can be logged.\n\n```go\ntype Update struct {\n\t// S is the message sent in this update.\n\tS string\n\t// At is the time that this update was sent.\n\tAt time.Time\n\n\t// Force determines if this update should not be throttled.\n\tForce bool\n}\n```\nUpdate is a single message sent (S) from a Task at a given time (At).\n\n```go\nfunc (u *Update) Throttled(next time.Time) bool\n```\nThrottled determines whether this update should be throttled, based on the given earliest time of the next update. The caller should determine how often updates should be throttled. An Update with Force=true is never throttled.\n\n```go\ntype WaitingTask struct {\n\t// contains filtered or unexported fields\n}\n```\nWaitingTask represents a task for which the total number of items to do work is on is unknown.\n\n```go\nfunc NewWaitingTask(msg string) *WaitingTask\n```\nNewWaitingTask returns a new \\*WaitingTask.\n\n```go\nfunc (w *WaitingTask) Complete()\n```\nComplete marks the task as completed.\n\n```go\nfunc (w *WaitingTask) Throttled() bool\n```\nThrottled implements Task.Throttled and returns true, indicating that this task is Throttled.\n\n```go\nfunc (w *WaitingTask) Updates() \u003c-chan *Update\n```\nDone implements Task.Done and returns a channel which is closed when Complete() is called.\n\n","path":"github.com/github/git-lfs/tasklog","name":"tasklog","synopsis":"","isRedistributable":true}
