mod

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 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) Download added in v0.4.5

func (c *Mod) Download(ctx context.Context, dependencies []string) error

Download all packages from config dependencies slice of strings format: origin@version: github.com/company/repository@v1.2.3 if version is absent use the latest commit

func (*Mod) Get

func (c *Mod) Get(ctx context.Context, requestedModule models.Module) error

Get download package.

func (*Mod) Update added in v0.5.0

func (c *Mod) Update(ctx context.Context, dependencies []string) error

Update all packages from config dependencies slice of strings format: origin@version: github.com/company/repository@v1.2.3 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