modfile

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ModFilename = "mod.jsonnet"

Variables

This section is empty.

Functions

func LoadModFile

func LoadModFile(dir string, m *ModFile) (bool, error)

func WriteModFile

func WriteModFile(dir string, m *ModFile) error

Types

type ModFile

type ModFile struct {
	// Module name
	Module string
	// JPath JSONNET_PATH
	// when not empty, symlinks will be created for JSONNET_PATH
	JPath string
	// Replace
	// version limit
	Replace map[PathIdentity]PathIdentity
	// Require same as go root
	// require { module: version }
	// indirect require { module:: version }
	Require map[string]Require
	// Comments
	Comments map[string][]string
}

type ModVersion

type ModVersion struct {
	Version    string
	TagVersion string
}

func ParseModVersion

func ParseModVersion(v string) ModVersion

v0.0.0,v

func (ModVersion) String

func (mv ModVersion) String() string

type PathIdentity

type PathIdentity struct {
	Version string
	Path    string
}

func ParsePathIdentity

func ParsePathIdentity(v string) (*PathIdentity, error)

func (PathIdentity) IsLocalReplace

func (r PathIdentity) IsLocalReplace() bool

func (PathIdentity) MarshalText

func (r PathIdentity) MarshalText() (text []byte, err error)

func (PathIdentity) String

func (r PathIdentity) String() string

func (*PathIdentity) UnmarshalText

func (r *PathIdentity) UnmarshalText(text []byte) error

type Require

type Require struct {
	ModVersion
	Indirect bool `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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