project

package
v0.10.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package project defines concepts that are related to a Terramate project.

Index

Constants

View Source
const MaxGlobalLabels = 256

MaxGlobalLabels allowed to be used in a globals block. TODO(i4k): get rid of this limit.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(root, prjAbsPath string) string

AbsPath takes the root project dir and a project's absolute path prjAbsPath and returns an absolute path to the file system.

func FriendlyFmtDir

func FriendlyFmtDir(root, wd, dir string) (string, bool)

FriendlyFmtDir formats the directory in a friendly way for tooling output.

Types

type Path

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

Path is a project path. The project paths are always absolute forward slashed paths with no lexical processing left, which means they must be cleaned paths. See:

https://pkg.go.dev/path#Clean

The project path has / as root.

func NewPath

func NewPath(p string) Path

NewPath creates a new project path. It panics if a relative path is provided.

func PrjAbsPath

func PrjAbsPath(root, abspath string) Path

PrjAbsPath converts the file system absolute path absdir into an absolute project path on the form /path/on/project relative to the given root.

func (Path) Dir

func (p Path) Dir() Path

Dir returns the path's directory.

func (Path) HasDirPrefix added in v0.4.4

func (p Path) HasDirPrefix(s string) bool

HasDirPrefix tests whether p begins with a directory prefix s.

func (Path) HasPrefix

func (p Path) HasPrefix(s string) bool

HasPrefix tests whether p begins with s prefix.

func (Path) HostPath

func (p Path) HostPath(rootdir string) string

HostPath computes the absolute host path from the provided rootdir.

func (Path) Join

func (p Path) Join(pathstr string) Path

Join joins the pathstr path into p. See path.Join for the underlying implementation.

func (Path) MarshalJSON added in v0.4.1

func (p Path) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (Path) String

func (p Path) String() string

String returns the path as a string.

func (*Path) UnmarshalJSON added in v0.4.1

func (p *Path) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Paths

type Paths []Path

Paths is a list of project paths.

func (Paths) Sort

func (paths Paths) Sort()

Sort paths in-place.

func (Paths) Strings

func (paths Paths) Strings() []string

Strings returns a []string from the []Path.

type Runtime

type Runtime map[string]cty.Value

Runtime is a map of runtime values exposed in the terramate namespace.

func (Runtime) Merge

func (runtime Runtime) Merge(other Runtime)

Merge other runtime values into the current set.

Jump to

Keyboard shortcuts

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