vdmspec

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package vdmspec defines the Spec and Remote struct types, and their associated methods.

Index

Constants

View Source
const (
	// MetaFileName is the name of the tracking file that vdm uses to record &
	// track remote statuses on disk.
	MetaFileName string = "VDMMETA"

	// GitType represents the string to match against for git remote types.
	GitType string = "git"
	// FileType represents the string to match against for file remote types.
	FileType string = "file"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Remote

type Remote struct {
	Type      string `json:"type,omitempty" yaml:"type,omitempty"`
	Remote    string `json:"remote" yaml:"remote"`
	Version   string `json:"version,omitempty" yaml:"version,omitempty"`
	LocalPath string `json:"local_path" yaml:"local_path"`
}

Remote defines the structure of each remote configuration in the vdm specfile.

func (Remote) GetVDMMeta

func (r Remote) GetVDMMeta() (Remote, error)

GetVDMMeta reads the metafile from disk, and returns it for further processing.

func (Remote) MakeMetaFilePath

func (r Remote) MakeMetaFilePath() string

MakeMetaFilePath constructs the metafile path that vdm will use to track a remote's state on disk.

func (Remote) OpMsg

func (r Remote) OpMsg() string

OpMsg constructs a loggable message outlining the specific operation being performed at the moment

func (Remote) WriteVDMMeta

func (r Remote) WriteVDMMeta() error

WriteVDMMeta writes the metafile contents to disk, the path of which is determined by Remote.MakeMetaFilePath.

type Spec

type Spec struct {
	Remotes []Remote `json:"remotes" yaml:"remotes"`
}

Spec defines the overall structure of the vmd specfile.

func GetSpecFromFile

func GetSpecFromFile(specFilePath string) (Spec, error)

GetSpecFromFile reads the specfile from disk (the path of which is determined by the user-supplied flag value), and returns it for further processing of remotes.

func (Spec) Validate

func (spec Spec) Validate() error

Validate performs runtime validations on the vdm specfile, and informs the caller of any failures encountered.

Jump to

Keyboard shortcuts

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