Documentation ¶
Index ¶
- func CopyToTempFile(src io.ReadCloser, dir string, pattern string) (*os.File, error)
- func CreateEmptyTempFile() (string, error)
- func FindDependencyGraphNodeBySemverRange(graph *models.DependencyGraph[*models.Package], name string, rangeStr string) *models.DependencyGraphNode[*models.Package]
- func NpmNodeModulesPackagePathToName(name string) string
- type WorkQueue
- type WorkQueueCallbackOnItemFn
- type WorkQueueCallbacks
- type WorkQueueFn
- type WorkQueueItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToTempFile ¶ added in v1.3.0
*
- CopyToTempFile copies the contents of the source `io.ReadCloser` to a temporary file on disk. *
- @param src The source `io.ReadCloser` containing the content to copy.
- @param dir The directory where the temporary file will be created. Can be an empty string to use the default system directory.
- @param pattern The prefix of the temporary file's name. *
- @return A pointer to the `os.File` representing the created temporary file.
- @return Any error encountered during the copy operation.
func CreateEmptyTempFile ¶ added in v1.3.0
func FindDependencyGraphNodeBySemverRange ¶ added in v1.5.6
func FindDependencyGraphNodeBySemverRange(graph *models.DependencyGraph[*models.Package], name string, rangeStr string) *models.DependencyGraphNode[*models.Package]
func NpmNodeModulesPackagePathToName ¶ added in v1.5.6
Re-use from: https://github.com/google/osv-scanner/blob/main/pkg/lockfile/parse-npm-lock.go#L128
Types ¶
type WorkQueue ¶
type WorkQueue[T WorkQueueItem] struct { // contains filtered or unexported fields }
func NewWorkQueue ¶
func NewWorkQueue[T WorkQueueItem](bufferSize int, concurrency int, handler WorkQueueFn[T]) *WorkQueue[T]
func (*WorkQueue[T]) WithCallbacks ¶
func (q *WorkQueue[T]) WithCallbacks(callbacks WorkQueueCallbacks[T])
type WorkQueueCallbackOnItemFn ¶
type WorkQueueCallbackOnItemFn[T WorkQueueItem] func(q *WorkQueue[T], item T)
type WorkQueueCallbacks ¶
type WorkQueueCallbacks[T WorkQueueItem] struct { OnAdd WorkQueueCallbackOnItemFn[T] OnDone WorkQueueCallbackOnItemFn[T] }
type WorkQueueFn ¶
type WorkQueueFn[T WorkQueueItem] func(q *WorkQueue[T], item T) error
type WorkQueueItem ¶
type WorkQueueItem interface {
Id() string
}
Click to show internal directories.
Click to hide internal directories.