Documentation
¶
Overview ¶
Package deps defines data structures and functions for recording the dependencies between packages.
Index ¶
- Variables
- func HasDomain(ip string) (string, bool)
- func Hash(r io.Reader) []byte
- func IsLocalPackage(pkg string) bool
- func IsNonPackage(path string) bool
- func IsVendor(path string) bool
- func ModuleName(path string) (string, bool)
- type Deps
- type File
- type Options
- type Package
- func (*Package) Descriptor() ([]byte, []int)deprecated
- func (x *Package) GetImportPath() string
- func (x *Package) GetImports() []string
- func (x *Package) GetName() string
- func (x *Package) GetSources() []*File
- func (x *Package) GetType() Package_Type
- func (*Package) ProtoMessage()
- func (x *Package) ProtoReflect() protoreflect.Message
- func (x *Package) Reset()
- func (x *Package) String() string
- type Package_Type
- func (Package_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Package_Type) Enum() *Package_Type
- func (Package_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Package_Type) Number() protoreflect.EnumNumber
- func (x Package_Type) String() string
- func (Package_Type) Type() protoreflect.EnumType
- type PathLabelMap
- type Remote
- type Repo
Constants ¶
This section is empty.
Variables ¶
var ( Package_Type_name = map[int32]string{ 0: "UNKNOWN", 1: "STDLIB", 2: "LIBRARY", 3: "PROGRAM", } Package_Type_value = map[string]int32{ "UNKNOWN": 0, "STDLIB": 1, "LIBRARY": 2, "PROGRAM": 3, } )
Enum value maps for Package_Type.
var File_deps_proto protoreflect.FileDescriptor
Functions ¶
func HasDomain ¶
HasDomain returns the first path component of the specified import path, and reports whether that prefix is a domain name.
func IsLocalPackage ¶
IsLocalPackage reports whether the specified import path is local.
func IsNonPackage ¶
IsNonPackage reports whether path is a special directory that should not be considered as a package. This is specific to Go.
func ModuleName ¶
ModuleName reports whether the specified directory contains a go.mod file, and if so reports the module name declared therein.
Types ¶
type Deps ¶
type Deps struct { Repositories []*Repo `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` // contains filtered or unexported fields }
Deps records dependency information for a collection of repositories.
func (*Deps) Descriptor
deprecated
func (*Deps) GetRepositories ¶
func (*Deps) ProtoMessage ¶
func (*Deps) ProtoMessage()
func (*Deps) ProtoReflect ¶
func (x *Deps) ProtoReflect() protoreflect.Message
type File ¶
type File struct { // The path of the file relative to the enclosing repository root. RepoPath string `protobuf:"bytes,1,opt,name=repo_path,json=repoPath,proto3" json:"repo_path,omitempty"` // A hash of the content of the file (sha256). Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` // contains filtered or unexported fields }
func (*File) Descriptor
deprecated
func (*File) GetRepoPath ¶
func (*File) ProtoMessage ¶
func (*File) ProtoMessage()
func (*File) ProtoReflect ¶
func (x *File) ProtoReflect() protoreflect.Message
type Options ¶
type Options struct { HashSourceFiles bool `json:"hashSourceFiles"` // record source file digests UseImportComments bool `json:"useImportComments"` // use import comments to name packages TrimRepoPrefix bool `json:"trimRepoPrefix"` // trim the repository prefix from each package StandardLibrary bool `json:"standardLibrary"` // treat the inputs as standard libraries PackagePrefix string `json:"packagePrefix"` // attribute this package prefix to repo contents }
Options control the behaviour of the Load function. A nil *Options behaves as a zero-valued Options struct.
type Package ¶
type Package struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // the simple name of the package (foo) ImportPath string `protobuf:"bytes,2,opt,name=import_path,json=importPath,proto3" json:"import_path,omitempty"` // the import path of the package (github.com/bar/foo) Type Package_Type `protobuf:"varint,5,opt,name=type,proto3,enum=deps.Package_Type" json:"type,omitempty"` // the type of package this is Imports []string `protobuf:"bytes,3,rep,name=imports,proto3" json:"imports,omitempty"` // import paths of direct dependencies Sources []*File `protobuf:"bytes,4,rep,name=sources,proto3" json:"sources,omitempty"` // the source files comprising the package // contains filtered or unexported fields }
func (*Package) Descriptor
deprecated
func (*Package) GetImportPath ¶
func (*Package) GetImports ¶
func (*Package) GetSources ¶
func (*Package) GetType ¶
func (x *Package) GetType() Package_Type
func (*Package) ProtoMessage ¶
func (*Package) ProtoMessage()
func (*Package) ProtoReflect ¶
func (x *Package) ProtoReflect() protoreflect.Message
type Package_Type ¶
type Package_Type int32
Classify the package type according to its role, if known.
const ( Package_UNKNOWN Package_Type = 0 // the package type is not known Package_STDLIB Package_Type = 1 // this is a standard library package Package_LIBRARY Package_Type = 2 // this is a library package Package_PROGRAM Package_Type = 3 // this is an executable )
func PackageType ¶
func PackageType(pkg *build.Package) Package_Type
PackageType classifies pkg based on its build metadata.
func (Package_Type) Descriptor ¶
func (Package_Type) Descriptor() protoreflect.EnumDescriptor
func (Package_Type) Enum ¶
func (x Package_Type) Enum() *Package_Type
func (Package_Type) EnumDescriptor
deprecated
func (Package_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Package_Type.Descriptor instead.
func (Package_Type) Number ¶
func (x Package_Type) Number() protoreflect.EnumNumber
func (Package_Type) String ¶
func (x Package_Type) String() string
func (Package_Type) Type ¶
func (Package_Type) Type() protoreflect.EnumType
type PathLabelMap ¶
A PathLabelMap maintains an association between paths and labels, and assigns subpaths that do not have their own labels a label based on the nearest enclosing parent.
func (PathLabelMap) Add ¶
func (p PathLabelMap) Add(path, label string)
Add adds path to the map with the specified label.
type Remote ¶
type Remote struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // the name of the remote ref Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // the remote fetch URL // contains filtered or unexported fields }
A Remote records information about a Git remote.
func (*Remote) Descriptor
deprecated
func (*Remote) ProtoMessage ¶
func (*Remote) ProtoMessage()
func (*Remote) ProtoReflect ¶
func (x *Remote) ProtoReflect() protoreflect.Message
type Repo ¶
type Repo struct { // The location where this repository was read from for diagnostic purposes; // usually the path of either a directory (for a local repo) or an archive // file. From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // The remotes defined by this repository. Remotes []*Remote `protobuf:"bytes,2,rep,name=remotes,proto3" json:"remotes,omitempty"` // The source packages defined inside this repository. Packages []*Package `protobuf:"bytes,3,rep,name=packages,proto3" json:"packages,omitempty"` // contains filtered or unexported fields }
Repo records information about a single repository.
func (*Repo) Descriptor
deprecated
func (*Repo) GetPackages ¶
func (*Repo) GetRemotes ¶
func (*Repo) ProtoMessage ¶
func (*Repo) ProtoMessage()
func (*Repo) ProtoReflect ¶
func (x *Repo) ProtoReflect() protoreflect.Message