valueobject

package
v0.0.0-...-f0d32e8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GoModFilename = "go.mod"
	GoSumFilename = "go.sum"
)

Variables

View Source
var ErrNotExist = errors.New("module does not exist")

Functions

func IsProbablyModule

func IsProbablyModule(path string) bool

Types

type Collector

type Collector struct {
	*GoClient
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(c *GoClient) *Collector

func (*Collector) CollectGoModules

func (c *Collector) CollectGoModules() error

func (*Collector) GetGoModule

func (c *Collector) GetGoModule(path string) *GoModule

func (*Collector) GetMain

func (c *Collector) GetMain() *GoModule

func (*Collector) IsSeen

func (c *Collector) IsSeen(path string) bool

type GoClient

type GoClient struct {
	Exec *hexec.Exec
	Dir  string
	// Environment variables used in "go get" etc.
	Environ []string

	Logger loggers.Logger
	// contains filtered or unexported fields
}

func (*GoClient) Get

func (c *GoClient) Get(args ...string) error

func (*GoClient) WrapModuleNotFound

func (c *GoClient) WrapModuleNotFound(err error) error

type GoModule

type GoModule struct {
	Path     string         // module path
	Version  string         // module version
	Versions []string       // available module versions (with -versions)
	Replace  *GoModule      // replaced by this module
	Time     *time.Time     // time version was created
	Update   *GoModule      // available update, if any (with -u)
	Main     bool           // is this the main module?
	Indirect bool           // is this module only an indirect dependency of main module?
	Dir      string         // directory holding files for this module, if any
	GoMod    string         // path to go.mod file for this module, if any
	Error    *goModuleError // error loading module
}

type GoModules

type GoModules []*GoModule

func (GoModules) GetByPath

func (modules GoModules) GetByPath(p string) *GoModule

type Import

type Import struct {
	// Module path
	Path string

	// Ignore any config in config.toml (will still follow imports).
	IgnoreConfig bool
	// Do not follow any configured imports.
	IgnoreImports bool
	// Do not mount any folder in this import.
	NoMounts bool
	// Never vendor this import (only allowed in main project).
	NoVendor bool
	// Turn off this module.
	Disable bool
	// File mounts.
	Mounts []Mount
	// contains filtered or unexported fields
}

type Module

type Module struct {
	AbsDir string
	Fs     afero.Fs

	Path   string
	Parent *Module

	MountDirs []Mount

	// Go Module supported only
	*GoModule
}

func (*Module) ApplyMounts

func (m *Module) ApplyMounts(moduleImport Import) error

func (*Module) Dir

func (m *Module) Dir() string

func (*Module) Mounts

func (m *Module) Mounts() []module.Mount

func (*Module) Owner

func (m *Module) Owner() module.Module

type Modules

type Modules []*Module

type Mount

type Mount struct {
	// Relative path in source repo, e.g. "scss".
	SourcePath string

	// Relative target path, e.g. "assets/bootstrap/scss".
	TargetPath string

	// Any file in this mount will be associated with this language.
	Language string

	// Include only files matching the given Glob patterns (string or slice).
	IncludeFiles any

	// Exclude all files matching the given Glob patterns (string or slice).
	ExcludeFiles any
}

func (Mount) Component

func (m Mount) Component() string

func (Mount) ComponentAndName

func (m Mount) ComponentAndName() (string, string)

func (Mount) Lang

func (m Mount) Lang() string

func (Mount) Source

func (m Mount) Source() string

func (Mount) Target

func (m Mount) Target() string

type ProjectModule

type ProjectModule struct {
	*Module
}

func (*ProjectModule) ApplyComponentsMounts

func (pm *ProjectModule) ApplyComponentsMounts(components []module.Component)

Jump to

Keyboard shortcuts

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