cuemod

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const ModSumFilename = "cue.mod/module.sum"

Variables

This section is empty.

Functions

func WithOpts

func WithOpts(ctx context.Context, fns ...OptFn) context.Context

Types

type Context

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

func ContextFor

func ContextFor(root string) *Context

func (*Context) Build

func (r *Context) Build(ctx context.Context, filename string) *build.Instance

func (*Context) Cleanup

func (r *Context) Cleanup() error

func (*Context) CueModRoot

func (r *Context) CueModRoot() string

func (*Context) Eval

func (r *Context) Eval(ctx context.Context, filename string, encoding cuex.Encoding) ([]byte, error)

func (*Context) Get

func (r *Context) Get(ctx context.Context, i string) error

func (*Context) ListCue

func (r *Context) ListCue(fromPath string) ([]string, error)

func (*Context) Resolve

func (r *Context) Resolve(ctx context.Context, importPath string, importedAt string) (string, error)

type ImportFunc

type ImportFunc = func(importPath string, importedAt string) (resolvedDir string, err error)

type Instance

type Instance = build.Instance

func Build

func Build(path string, optionFns ...OptionFunc) *Instance

type Mod

type Mod struct {
	modfile.ModFile

	modfile.ModVersion

	// Repo where module in vcs root
	Repo string
	// Sum repo absolute dir sum
	Sum string
	// Lang if set, will trigger extractor like `go`
	Lang string
	// Dir module absolute dir
	Dir string
}

func (*Mod) LoadInfo

func (m *Mod) LoadInfo(ctx context.Context) (bool, error)

func (*Mod) ResolveImportPath

func (m *Mod) ResolveImportPath(ctx context.Context, cache *cache, importPath string, version string) (*Path, error)

func (*Mod) Resolved

func (m *Mod) Resolved() bool

func (*Mod) SetRequire

func (m *Mod) SetRequire(module string, modVersion modfile.ModVersion, indirect bool)

func (*Mod) String

func (m *Mod) String() string

type OptFn

type OptFn = func(o *Opts)

func OptUpgrade

func OptUpgrade(b bool) OptFn

func OptVerbose

func OptVerbose(v bool) OptFn

type OptionFunc

type OptionFunc = func(c *load.Config)

func OptImportFunc

func OptImportFunc(importFunc ImportFunc) OptionFunc

func OptRoot

func OptRoot(dir string) OptionFunc

type Opts

type Opts struct {
	Upgrade bool `name:"upgrade,u" usage:"need upgrade dependencies"`
	Verbose bool `name:"verbose,v" usage:"verbose"`
}

func OptsFromContext

func OptsFromContext(ctx context.Context) Opts

type Path

type Path struct {
	*Mod
	SubPath string
	Replace *ReplaceRule
}

func PathFor

func PathFor(mod *Mod, importPath string) *Path

func (*Path) ImportPath

func (i *Path) ImportPath() string

func (*Path) ImportPathDir

func (i *Path) ImportPathDir() string

func (*Path) RepoRootDir

func (i *Path) RepoRootDir() string

func (*Path) ResolvedImportPath

func (i *Path) ResolvedImportPath() string

func (*Path) SymlinkOrImport

func (i *Path) SymlinkOrImport(ctx context.Context, root string) error

func (Path) WithReplace

func (i Path) WithReplace(from string, replaceTarget modfile.ReplaceTarget) *Path

type ReplaceRule

type ReplaceRule struct {
	From string
	modfile.ReplaceTarget
}

type VersionFixer

type VersionFixer = func(repo string, version string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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