UNPKG

snyk-go-plugin

Version:
104 lines (103 loc) 2.5 kB
import type { DepGraph } from '@snyk/dep-graph'; export interface DepDict { [name: string]: DepTree; } export interface DepTree { name: string; version?: string; dependencies?: DepDict; packageFormatVersion?: string; _counts?: any; _isProjSubpkg?: boolean; } export interface CountDict { [k: string]: number; } export interface Options { debug?: boolean; file?: string; args?: string[]; /** * Attach component-metadata labels (hash:sha-256, distribution:url) to * dependency nodes, sourced from go.sum and the Go module proxy. * * Read at the top level (not under `configuration`) to match the shared * convention used by the other plugins (snyk-mvn-plugin, * snyk-nodejs-plugin, ...); the CLI injects it top-level for all plugins. */ includeComponentMetadata?: boolean; configuration?: { includeGoStandardLibraryDeps?: boolean; includePackageUrls?: boolean; /** * Temporary config value to enable proper identification * of replaced modules. */ useReplaceName?: boolean; }; } export interface DepGraphResult { plugin: PluginMetadata; dependencyGraph: DepGraph; } export interface DepTreeResult { plugin: PluginMetadata; package: DepTree; } export interface PluginMetadata { name: string; runtime: string | undefined; targetFile: any; } export interface GoPackage { Dir: string; ImportPath: string; ImportComment?: string; Name: string; Doc?: string; Target?: string; Shlib?: string; Goroot?: boolean; Standard?: boolean; Stale?: boolean; StaleReason?: string; Root?: string; ConflictDir?: string; BinaryOnly?: boolean; ForTest?: string; Export?: string; Module?: GoModule; Match?: string[]; DepOnly?: boolean; Imports?: string[]; ImportMap: { string: string; }; Deps: string[]; TestImports: string[]; XTestImports: string[]; Incomplete: boolean; Error: GoPackageError; DepsErrors: GoPackageError[]; } export interface GoModule { Path: string; Version: string; Versions: string[]; Replace: GoModule; Time: string; Update: GoModule; Main: boolean; Indirect: boolean; Dir: string; GoMod: string; Sum: string; GoModSum: string; Error: string; } interface GoPackageError { ImportStack: string[]; Pos: string; Err: string; } export {};