mod

package
v0.185.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyslModulesOff    = "off"
	SyslModulesOn     = "on"
	SyslModulesGitHub = "github"
	SyslModulesGoMod  = "gomod"
	MasterBranch      = "master"
)

Variables

View Source
var GitHubMode = os.Getenv("SYSL_MODULES") == SyslModulesGitHub
View Source
var SyslModules = os.Getenv("SYSL_MODULES") != SyslModulesOff

Functions

func AppendVersion added in v0.179.0

func AppendVersion(path, ver string) string

func ExtractVersion added in v0.98.0

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

func SyslModInit added in v0.6.3

func SyslModInit(modName string) error

Assumes that a go module and a sysl module is mutually exclusive. This function makes the assumption that the CWD is not a go module since we hijack this command and use go.mod and possibly go.sum to determine whether the current folder/project is a sysl module

Types

type DependencyManager added in v0.179.0

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 Fs

type Fs struct {
	afero.Fs
	// contains filtered or unexported fields
}

func NewFs

func NewFs(fs afero.Fs, root string) *Fs

func (*Fs) Name

func (fs *Fs) Name() string

func (*Fs) Open

func (fs *Fs) Open(name string) (afero.File, error)

func (*Fs) OpenFile

func (fs *Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

func (*Fs) OpenWithModule added in v0.180.0

func (fs *Fs) OpenWithModule(name string) (afero.File, *Module, error)

type Module

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

func Retrieve added in v0.180.0

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 added in v0.123.0

func (m *Modules) Len() int

Jump to

Keyboard shortcuts

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