mod

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const MasterBranch = "master"
View Source
const SHALength = 12

Variables

This section is empty.

Functions

func AppendVersion

func AppendVersion(path, ver string) string

func Config

func Config(m ModeType, goModopt GoModulesOptions, githubOpt GitHubOptions) error

func ExtractVersion

func ExtractVersion(path string) (newpath, ver string)

func FileExists added in v0.0.17

func FileExists(fs afero.Fs, filename string, isDir bool) bool

Types

type DependencyManager

type DependencyManager interface {
	// Download external dependency to local directory
	Get(filename, ver string, m *Modules) (*Module, error)
	// Find dependency in m *Modules
	Find(filename, ver string, m *Modules) *Module
	// Load local cache into m *Modules
	Load(m *Modules) error
}

type GitHubOptions added in v0.0.19

type GitHubOptions struct {
	CacheDir    string
	AccessToken string
	Fs          afero.Fs
}

type GoModulesOptions added in v0.0.19

type GoModulesOptions struct {
	Root    string
	ModName string
}

type Mode added in v0.0.21

type Mode struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type ModeType

type ModeType string
const (
	GitHubMode    ModeType = "github"
	GoModulesMode ModeType = "go modules"
)

type Module

type Module struct {
	// The name of module joined by forward slash(/). e.g. "github.com/anz-bank/foo"
	Name string
	// The absolute path to the module.
	// e.g. "/Users/username/go/pkg/mod/github.com/anz-bank/foo@v1.1.0" on Linux and macOS
	//      "C:\Users\username\go\pkg\mod\github.com\anz-bank\foo@v1.1.0" on Windows
	Dir string
	// The version of the module. e.g. "v1.1.0"
	Version string
}

func Retrieve

func Retrieve(name string, ver string) (*Module, error)

type Modules

type Modules []*Module

func (*Modules) Add

func (m *Modules) Add(v *Module)

func (*Modules) Len

func (m *Modules) Len() int

type NotFoundError added in v0.0.17

type NotFoundError struct {
	Message string
}

func (*NotFoundError) Error added in v0.0.17

func (e *NotFoundError) Error() string

type RateLimitError added in v0.0.17

type RateLimitError = github.RateLimitError

Jump to

Keyboard shortcuts

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