snyk-go-plugin
Version:
Snyk CLI Golang plugin
41 lines (40 loc) • 1.91 kB
TypeScript
import { DepGraph, DepGraphBuilder } from '@snyk/dep-graph';
import { GoPackage, Options } from './types';
import { GoSumHashes } from './component-metadata';
export declare function getDepGraph(root: string, targetFile: string, options?: Options): Promise<DepGraph>;
interface GraphOptions {
stdlibVersion?: string;
additionalArgs?: string[];
includeGoStandardLibraryDeps?: boolean;
includePackageUrls?: boolean;
/**
* Temporary: This option fixes the wrongful identification of a module
* when it is actually being replaced with a differently named module.
* This option is being used for a gradual rollout of the fix, and
* removed once the rollout is complete.
**/
useReplaceName?: boolean;
/**
* Attach component-metadata labels (hash:sha-256, distribution:url) to
* dependency nodes, sourced from go.sum.
*/
includeComponentMetadata?: boolean;
/**
* Internal: go.sum hashes parsed once and threaded through the recursion so
* node builders can look up module hashes. Populated when
* includeComponentMetadata is set.
*/
goSumHashes?: GoSumHashes;
/**
* Internal: effective GOPROXY from `go env GOPROXY`, resolved once and
* threaded through so distribution URLs honour the go env file / env var
* precedence rather than only the process environment. Populated when
* includeComponentMetadata is set.
*/
goProxy?: string;
}
export declare function buildDepGraphFromImportsAndModules(root?: string, targetFile?: string, options?: GraphOptions): Promise<DepGraph>;
export declare function buildGraph(depGraphBuilder: DepGraphBuilder, depPackages: string[], packagesByName: {
[name: string]: GoPackage;
}, currentParent: string, childrenChain: Map<string, string[]>, ancestorsChain: Map<string, string[]>, options: GraphOptions, visited?: Set<string>): void;
export {};