{"modulePath":"github.com/wavetermdev/waveterm","version":"v0.14.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utilds\n\n## Functions\n\n```go\nfunc Errorf(code string, format string, args ...interface{}) error\n```\nErrorf creates a formatted error wrapped in a CodedError. This is a convenience function that combines fmt.Errorf with MakeCodedError.\n\n```go\nfunc GetErrorCode(err error) string\n```\nGetErrorCode extracts the error code from anywhere in the error chain. Returns empty string if no CodedError is found.\n\n```go\nfunc GetErrorSubCode(err error) string\n```\nGetErrorSubCode extracts the error subcode from anywhere in the error chain. Returns empty string if no CodedError is found or if SubCode is not set.\n\n## Types\n\n```go\ntype CodedError struct {\n\tCode    string\n\tSubCode string\n\tErr     error\n}\n```\nCodedError wraps an error with a string code for categorization. The code can be extracted from anywhere in an error chain using GetErrorCode. SubCode provides additional granularity for error classification.\n\n```go\nfunc MakeCodedError(code string, err error) CodedError\n```\nMakeCodedError creates a new CodedError with the given code and error.\n\n```go\nfunc MakeSubCodedError(code string, subCode string, err error) CodedError\n```\nMakeSubCodedError creates a new CodedError with the given code, subcode, and error.\n\n```go\nfunc (e CodedError) Error() string\n```\n\n```go\nfunc (e CodedError) Unwrap() error\n```\n\n```go\ntype IdList[T any] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (il *IdList[T]) GetList() []T\n```\n\n```go\nfunc (il *IdList[T]) Register(val T) string\n```\n\n```go\nfunc (il *IdList[T]) RegisterWithId(id string, val T)\n```\n\n```go\nfunc (il *IdList[T]) Unregister(id string)\n```\n\n```go\ntype MultiReaderLineBuffer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc MakeMultiReaderLineBuffer(maxLines int) *MultiReaderLineBuffer\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) AddLine(line string)\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) GetLineCount() int\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) GetLines() []string\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) GetTotalLineCount() int\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) ReadAll(r io.Reader)\n```\n\n```go\nfunc (mrlb *MultiReaderLineBuffer) SetLineCallback(callback func(string))\n```\ncallback is synchronous.  will block the consuming of lines and guaranteed to run in order.  it is also guaranteed only one callback will be running at a time (protected by the internal line lock)\n\n```go\ntype QuickReorderQueue[T any] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc MakeQuickReorderQueue[T any](bufSize int, timeout time.Duration) *QuickReorderQueue[T]\n```\n\n```go\nfunc (q *QuickReorderQueue[T]) C() \u003c-chan T\n```\n\n```go\nfunc (q *QuickReorderQueue[T]) Close()\n```\n\n```go\nfunc (q *QuickReorderQueue[T]) QueueItem(sessionId string, seqNum int, data T) error\n```\n\n```go\nfunc (q *QuickReorderQueue[T]) SetNextSeqNum(seqNum int)\n```\n\n```go\ntype ReaderLineBuffer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc MakeReaderLineBuffer(reader io.Reader, maxLines int) *ReaderLineBuffer\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) GetLineCount() int\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) GetLines() []string\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) GetTotalLineCount() int\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) IsDone() bool\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) ReadAll()\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) ReadLine() (string, error)\n```\n\n```go\nfunc (rlb *ReaderLineBuffer) SetLineCallback(callback func(string))\n```\n\n```go\ntype SyncCache[T any] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc MakeSyncCache[T any](computeFn func() (T, error)) *SyncCache[T]\n```\n\n```go\nfunc (sc *SyncCache[T]) Get(force bool) (T, error)\n```\n\n```go\ntype VersionTs struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *VersionTs) GetVersionTs() int64\n```\n\n```go\ntype WorkQueue[T any] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWorkQueue[T any](workFn func(T)) *WorkQueue[T]\n```\n\n```go\nfunc (wq *WorkQueue[T]) Close(immediate bool)\n```\n\n```go\nfunc (wq *WorkQueue[T]) Enqueue(item T) bool\n```\n\n```go\nfunc (wq *WorkQueue[T]) Wait()\n```\n\n","path":"github.com/wavetermdev/waveterm/pkg/utilds","name":"utilds","synopsis":"","isRedistributable":true}
