mod

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockFile added in v0.4.0

type LockFile interface {
	Read(moduleName string) (models.LockFileInfo, error)
	Write(
		moduleName string, revisionVersion string, installedPackageHash models.ModuleHash,
	) error
}

LockFile should implement adapter for lock file workflow

type Mod

type Mod struct {
	// contains filtered or unexported fields
}

Mod implement package manager's commands

func New

func New(storage Storage, moduleConfig ModuleConfig, lockFile LockFile) *Mod

func (*Mod) Get

func (c *Mod) Get(ctx context.Context, requestedDependency string) error

Get download package. requestedDependency string format: origin@version: github.com/company/[email protected] if version is absent use the latest commit

type ModuleConfig

type ModuleConfig interface {
	ReadFromRepo(ctx context.Context, repo repository.Repo, revision models.Revision) (models.ModuleConfig, error)
}

ModuleConfig should implement adapter for reading module configs

type Storage

type Storage interface {
	CreateCacheRepositoryDir(name string) (string, error)
	CreateCacheDownloadDir(models.CacheDownloadPaths) error
	GetCacheDownloadPaths(module models.Module, revision models.Revision) models.CacheDownloadPaths
	Install(
		cacheDownloadPaths models.CacheDownloadPaths,
		module models.Module,
		revision models.Revision,
		moduleConfig models.ModuleConfig,
	) (models.ModuleHash, error)
	GetInstalledModuleHash(moduleName string, revisionVersion string) (models.ModuleHash, error)
	IsModuleInstalled(module models.Module) (bool, error)
}

Storage should implement workflow with storage adapter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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