Initial commit.

This commit is contained in:
2020-02-06 15:09:25 +05:00
commit a7bf1f29ba
22 changed files with 1049 additions and 0 deletions

18
structs/dependency.go Normal file
View File

@@ -0,0 +1,18 @@
package structs
// Dependency represents single dependency data.
type Dependency struct {
// License is a license name for dependency.
License License
// Name is a dependency name as it appears in package manager's
// lock file or in sources if no package manager is used.
Name string
// Parent is a path to parent package.
Parent string
// VCS is a VCS data obtained for dependency.
VCS VCSData
// Version is a dependency version used in project.
Version string
// URL is a web URL for that dependency (Github, Gitlab, etc.).
URL string
}

7
structs/license.go Normal file
View File

@@ -0,0 +1,7 @@
package structs
type License struct {
Copyrights string
Name string
URL string
}

19
structs/vcsdata.go Normal file
View File

@@ -0,0 +1,19 @@
package structs
// VCSData describes structure of go-import and go-source data.
type VCSData struct {
// Branch is a VCS branch used.
Branch string
// Revision is a VCS revision used.
Revision string
// SourceURLDirTemplate is a template for sources dirs URLs. E.g.:
// https://sources.dev.pztrn.name/pztrn/glp/src/branch/master{/dir}
SourceURLDirTemplate string
// SourceURLFileTemplate is a template for sources files URLs. E.g.:
// https://sources.dev.pztrn.name/pztrn/glp/src/branch/master{/dir}/{file}#L{line}
SourceURLFileTemplate string
// VCS is a VCS name (e.g. "git").
VCS string
// VCSPath is a VCS repository path.
VCSPath string
}