mod

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mod

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

Mod implement package manager's commands

func New

func New(storage Storage, moduleConfig ModuleConfig) *Mod

func (*Mod) Get

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

Get download package. module: string format: origin@version: github.com/company/repository@v1.2.3 if version is absent use the latest

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 {
	CreateCacheDir(name string) (string, error)
	CreateCacheDownloadDir(module models.Module) (string, error)
	GetDownloadArchivePath(cacheDownloadPath string, revision models.Revision) string
	Install(archivePath string, moduleConfig models.ModuleConfig) 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