Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrVersionNotFound = errors.New("version not found") ErrFileNotFound = errors.New("file not found") ErrModuleNotInstalled = errors.New("module not installed") )
var (
ErrModuleNotFoundInLockFile = errors.New("module not found in lock file")
)
var (
ErrRequestedVersionNotGenerated = errors.New("requested version is not generated")
)
Functions ¶
This section is empty.
Types ¶
type CacheDownloadPaths ¶
type CacheDownloadPaths struct {
// CacheDownload path to dir with downloaded cache
CacheDownloadDir string
// ArchiveFile full path to downloaded archive of module
ArchiveFile string
// ArchiveHashFile full path to file with hash of archive
ArchiveHashFile string
// ModuleInfoFile full path to file with info about downloaded module
ModuleInfoFile string
}
CacheDownloadPaths collects cache download paths to: * archive * file with archive hash * info about downloaded module
type GeneratedVersionParts ¶
func (GeneratedVersionParts) GetVersionString ¶
func (g GeneratedVersionParts) GetVersionString() string
type LockFileInfo ¶
type LockFileInfo struct {
Name string
Version string
Hash ModuleHash
}
LockFileInfo contains information about module from lock file
type Module ¶
type Module struct {
Name string // Full path on remote repository
Version RequestedVersion // Version obtained from config (Omitted if version was omitted)
}
Module contain requested dependency name and its version
func NewModule ¶
NewModule create Module struct from raw dependency string: remote@version dependency string format: origin@version: github.com/company/repository@v1.2.3
func NewModuleFromLockFileInfo ¶
func NewModuleFromLockFileInfo(lockFileInfo LockFileInfo) Module
NewModuleFromLockFileInfo create Module struct from LockFileInfo struct
type ModuleConfig ¶
type ModuleConfig struct {
// Directories contains dirs with proto files (buf.work.yaml)
Directories []string
// Dependencies contains list of required dependencies in repository
// it could be from easyp.yaml or from buf
Dependencies []Module
}
ModuleConfig contains module config such as dirs from buf.work.yaml
type ModuleHash ¶
type ModuleHash string
ModuleHash alias for module's hash used in lock file for verification
type RequestedVersion ¶
type RequestedVersion string
RequestedVersion for installing
const ( // If version was omitted Omitted RequestedVersion = "" )
func (RequestedVersion) GetParts ¶
func (v RequestedVersion) GetParts() (GeneratedVersionParts, error)
GetParts return parts of GeneratedVersion if RequestedVersion is not generated return error
func (RequestedVersion) IsGenerated ¶
func (v RequestedVersion) IsGenerated() bool
IsGenerated check if requested was generated and it's not a commit's tag like v0.0.0-20240222234643-814bf88cf225 in go mod
func (RequestedVersion) IsOmitted ¶
func (v RequestedVersion) IsOmitted() bool
IsOmitted check if requested version is omitted