core

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package core is generated by github.com/omeid/go-resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteQuery

func ExecuteQuery(w *Workspace, q Query, dryRun bool, verbose int) error

ExecuteQuery executes the given query in the workspace

func OsEnv

func OsEnv() map[string]string

OsEnv returns current process environment as a map

func RenderTemplate

func RenderTemplate(tmpl string, env map[string]string, args map[string]string) (string, error)

RenderTemplate renders the given template with env/args map

Types

type Execution

type Execution struct {
	Workspace *Workspace
	Query     *Query
	Project   *Project
	Task      *Task
	DryRun    bool
	Verbose   int
}

Execution represents a task and context being invoked

func (*Execution) Execute

func (e *Execution) Execute() error

Execute executes the current task

type File added in v1.0.2

type File struct {
	*bytes.Reader
	// contains filtered or unexported fields
}

File implements http.File

func (*File) Close added in v1.0.2

func (f *File) Close() error

Close is a noop-closer.

func (*File) Readdir added in v1.0.2

func (f *File) Readdir(count int) ([]os.FileInfo, error)

Readdir implements http.File.Readdir

func (*File) Stat added in v1.0.2

func (f *File) Stat() (os.FileInfo, error)

Stat implements http.Stat.Readdir

type FileInfo added in v1.0.2

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

FileInfo implements the os.FileInfo interface.

func (*FileInfo) IsDir added in v1.0.2

func (f *FileInfo) IsDir() bool

IsDir implements os.FileInfo.IsDir

func (*FileInfo) ModTime added in v1.0.2

func (f *FileInfo) ModTime() time.Time

ModTime implements os.FileInfo.ModTime

func (*FileInfo) Mode added in v1.0.2

func (f *FileInfo) Mode() os.FileMode

Mode implements os.FileInfo.Mode

func (*FileInfo) Name added in v1.0.2

func (f *FileInfo) Name() string

Name implements os.FileInfo.Name

func (*FileInfo) Readdir added in v1.0.2

func (f *FileInfo) Readdir(count int) ([]os.FileInfo, error)

Readdir implements os.FileInfo.Readdir

func (*FileInfo) Size added in v1.0.2

func (f *FileInfo) Size() int64

Size implements os.FileInfo.Size

func (*FileInfo) Sys added in v1.0.2

func (f *FileInfo) Sys() interface{}

Sys returns the underlying value.

type FileSystem added in v1.0.2

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

FileSystem is an http.FileSystem implementation.

var FS *FileSystem

func (*FileSystem) Open added in v1.0.2

func (fs *FileSystem) Open(name string) (http.File, error)

Open implements http.FileSystem.Open

func (*FileSystem) String added in v1.0.2

func (fs *FileSystem) String(name string) (string, bool)

String returns the content of the file as string.

type Project

type Project struct {
	Src      string
	Cwd      string
	Name     string
	Desc     string
	Tags     []string
	Discover []string
	Mixin    []string
	Env      map[string]string
	EnvFiles []string
	Tasks    map[string]Task
}

Project represents a parsed project

func ParseProject

func ParseProject(path string) (Project, error)

ParseProject parses the given project

type Query

type Query struct {
	Raw    string
	Task   string
	Tags   []string
	Params map[string]string
}

Query reprents a task execution query

func ParseQueries

func ParseQueries(qs []string) []Query

ParseQueries parses a query from the command line

type Task

type Task struct {
	Name       string
	Desc       string
	Cmd        string
	Before     string
	After      string
	Error      string
	Shell      string
	Retry      int
	RetryDelay time.Duration
}

Task reprents a parsed task

type Workspace

type Workspace struct {
	Cwd      string
	Projects []Project
}

Workspace represents the current myke workspace

func ParseWorkspace

func ParseWorkspace(cwd string) (Workspace, error)

ParseWorkspace parses the current workspace

Jump to

Keyboard shortcuts

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