Help us shape the future of Go! Take the 2026 Go Developer Survey

intel

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSince

func FormatSince(d time.Duration) string

func IsMaliciousID

func IsMaliciousID(id string) bool

func MaliciousVulns

func MaliciousVulns(vulns []malindex.Vulnerability) []malindex.Vulnerability

Types

type FeedRequest

type FeedRequest struct {
	Since     time.Duration
	Ecosystem string
	Limit     int
	CacheDir  string
	CacheTTL  time.Duration
	Timeout   time.Duration
}

type FeedResponse

type FeedResponse struct {
	Entries     []source.PackageEntry
	WindowStats source.WindowStats
	Total       int
	FromCache   bool
}

type Provider

type Provider interface {
	Name() string

	GetVuln(ctx context.Context, id string) (*malindex.Vulnerability, error)
	Query(ctx context.Context, q malindex.QueryRequest) (*malindex.QueryResponse, error)
	QueryBatch(ctx context.Context, queries []malindex.QueryRequest) (*malindex.BatchQueryResponse, error)

	Feed(ctx context.Context, req FeedRequest) (*FeedResponse, error)
	Search(ctx context.Context, req SearchRequest) (*SearchResponse, error)
	LoadMaliciousIndex(ctx context.Context, onProgress malindex.IndexLoadProgress, onStatus malindex.IndexLoadStatus) (*malindex.MaliciousIndex, error)

	VulnPageURL(id string) string

	StartBackgroundSync(ctx context.Context)
	// WaitBackgroundSync blocks until any in-flight background refresh finishes
	// so it persists before the process exits. Bounded by the network timeout.
	WaitBackgroundSync()
	SyncStatus() sync.Status
}

Provider is the malicious-package intelligence backend. depx has a single source — the ProjectDiscovery inventory export — served entirely from a local compiled index after the first download.

func New

func New(version string, cfg *config.Config) (Provider, error)

New constructs the inventory-backed intelligence provider.

func NewFromClient

func NewFromClient(version string, cfg *config.Config) (Provider, error)

type SearchRequest

type SearchRequest struct {
	Query      string
	Ecosystem  string
	Limit      int
	OnProgress malindex.IndexLoadProgress
	OnStatus   malindex.IndexLoadStatus
}

type SearchResponse

type SearchResponse struct {
	Entries []source.PackageEntry
	Total   int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL