mdlrf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMdlrFileNotExist        = errors.New("error mdlr.yml file does not exist")
	ErrMdlrFileInvalidPath     = errors.New("error invalid path to mdl.yml file")
	ErrMdlrFileAlreadyLoaded   = errors.New("error mdlr.yml file already loaded")
	ErrMdlrFileAlreadyExists   = errors.New("error mdlr.yml file already exists")
	ErrInvalidSyntaxInMdlrFile = errors.New("error invalid syntax tag in mdlr.yml file. valid syntax tags include: 1")
	ErrInvalidMdlrFile         = errors.New("error invalid mdlr.yml file")
	ErrInvalidModuleDefinition = errors.New("error invalid module definition")
	ErrInvalidModuleType       = errors.New("error invalid module type. must be either git or hg")
	ErrModuleNameAlreadyInUse  = errors.New("error the module name is already used in the same mdlr.yml file")
	ErrModuleNameNotExist      = errors.New("error the module name does not exist in the mdlr.yml file")
	ErrNoModules               = errors.New("error no modules are defined in the mdlr.yml file")
)
View Source
var Log = config.Cfg().GetLogger()

Functions

This section is empty.

Types

type MdlrCtx

type MdlrCtx struct {
	IsFileReady bool
	FilePath    string
	MdlrFile    *MdlrFile
}

func NewMdlrCtxForCmd

func NewMdlrCtxForCmd() (*MdlrCtx, error)

func (*MdlrCtx) Add

func (ctx *MdlrCtx) Add(name string, mType string, path string, url string, branch string, commit string) error

func (*MdlrCtx) Import

func (ctx *MdlrCtx) Import(specificName string, force bool) error

func (*MdlrCtx) Init

func (ctx *MdlrCtx) Init() error

func (*MdlrCtx) List

func (ctx *MdlrCtx) List() (string, error)

func (*MdlrCtx) Remove

func (ctx *MdlrCtx) Remove(name string, dropFiles bool) error

func (*MdlrCtx) Status

func (ctx *MdlrCtx) Status(name string) (string, error)

func (*MdlrCtx) Update

func (ctx *MdlrCtx) Update(specificName, branch, commit string, force bool) error

type MdlrFile

type MdlrFile struct {
	ParentDirectory  string             `yaml:"-"`
	AbsoluteFilePath string             `yaml:"-"`
	Syntax           int64              `yaml:"syntax"`
	Modules          map[string]*Module `yaml:"modules,flow"`
}

func NewMdlrFile

func NewMdlrFile() *MdlrFile

func (*MdlrFile) Exists

func (mf *MdlrFile) Exists(absFilePath string) bool

func (*MdlrFile) Load

func (mf *MdlrFile) Load(absFilePath string) error

func (*MdlrFile) Persist

func (mf *MdlrFile) Persist() error

func (*MdlrFile) Prepare

func (mf *MdlrFile) Prepare(absFilePath string)

func (*MdlrFile) Validate

func (mf *MdlrFile) Validate() error

type Module

type Module struct {
	Name         string `yaml:"-"` // This is the key used for the module -- populated outside of the YAML object
	Type         string `yaml:"type"`
	Path         string `yaml:"path"`
	AbsolutePath string `yaml:"-"`
	URL          string `yaml:"url"`
	Branch       string `yaml:"branch"`
	Commit       string `yaml:"commit"`
	Depth        int64  `yaml:"depth"`
	vcs.Context  `yaml:"-"`
}

func (*Module) Prepare

func (mod *Module) Prepare(name string, parentDir string)

func (*Module) Validate

func (mod *Module) Validate() error

Jump to

Keyboard shortcuts

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