glp/parsers/parserinterface/parserinterface.go

17 lines
500 B
Go
Raw Normal View History

2020-02-06 15:09:25 +05:00
package parserinterface
import (
// local
"go.dev.pztrn.name/glp/structs"
)
// Interface is a generic parser interface.
type Interface interface {
// Detect should return true if project should be parsed using
// this parser and false otherwise. May optionally return package
// flavor (e.g. dependency management utility name).
Detect(pkgPath string) (bool, string)
// GetDependencies parses project for dependencies.
GetDependencies(flavor string, pkgPath string) []*structs.Dependency
}