models

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVersionNotFound    = errors.New("version not found")
	ErrFileNotFound       = errors.New("file not found")
	ErrModuleNotInstalled = errors.New("module not installed")
)
View Source
var (
	ErrModuleNotFoundInLockFile = errors.New("module not found in lock file")
)
View Source
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

type GeneratedVersionParts struct {
	Datetime   string
	CommitHash string
}

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

func NewModule(dependency string) Module

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

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

type Revision

type Revision struct {
	CommitHash string // commit's hash
	Version    string // commit's tag or generated version
}

Revision collects references to module's commit Revision is actual module information from repository

Jump to

Keyboard shortcuts

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