gg_exec_bucket

package
v0.2.53 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: BSD-3-Clause Imports: 10 Imported by: 1

README

GG Bucket

This module is a simple "container" to execute programs.

Usually a "bucket" is a useful alternative to call a program from console. CLI programs are a good client for a bucket.

Examples of useful buckets:

  • Node or ts-node programs
  • Python programs
  • Ruby programs
  • etc...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketExec

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

BucketExec main executable container

func NewBucketExec

func NewBucketExec(root, execPath string, global bool) (instance *BucketExec)

func (*BucketExec) DownloaderAddResource

func (instance *BucketExec) DownloaderAddResource(remotePath, localRelativePath string) *BucketExec

func (*BucketExec) DownloaderRun

func (instance *BucketExec) DownloaderRun(force bool) ([]string, []error)

func (*BucketExec) DownloaderSetRemoteRoot

func (instance *BucketExec) DownloaderSetRemoteRoot(remotePath string) *BucketExec

func (*BucketExec) NewGit

func (instance *BucketExec) NewGit() *git.GitExec

func (*BucketExec) NewNpm

func (instance *BucketExec) NewNpm() *npm.NpmExec

func (*BucketExec) NewProgram

func (instance *BucketExec) NewProgram(programFile string) (*BucketProgram, error)

func (*BucketExec) NewYarn

func (instance *BucketExec) NewYarn() *yarn.YarnExec

func (*BucketExec) OnError

func (instance *BucketExec) OnError(callback func(err error)) *BucketExec

func (*BucketExec) OnFinish

func (instance *BucketExec) OnFinish(callback func(response interface{}, err error)) *BucketExec

func (*BucketExec) OnSuccess

func (instance *BucketExec) OnSuccess(callback func(response interface{})) *BucketExec

func (*BucketExec) OnTimeout

func (instance *BucketExec) OnTimeout(callback func()) *BucketExec

func (*BucketExec) Run

func (instance *BucketExec) Run(programFile string, model map[string]interface{}, args ...interface{}) (pid int, task *gg_utils.AsyncTask, err error)

func (*BucketExec) RunSync

func (instance *BucketExec) RunSync(programFile string, model map[string]interface{}, args ...interface{}) (pid, elapsed int, response interface{}, err error)

func (*BucketExec) SetRoot

func (instance *BucketExec) SetRoot(root string) *BucketExec

func (*BucketExec) SetTimeout

func (instance *BucketExec) SetTimeout(timeout time.Duration) *BucketExec

type BucketHelper

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

BucketHelper main executable container

var Bucket *BucketHelper

func NewBucketHelper

func NewBucketHelper() (instance *BucketHelper)

func (*BucketHelper) NewBucket

func (instance *BucketHelper) NewBucket(execPath string, global bool) *BucketExec

func (*BucketHelper) SetRoot

func (instance *BucketHelper) SetRoot(root string)

type BucketProgram

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

func (*BucketProgram) Merge

func (instance *BucketProgram) Merge(model map[string]interface{}) error

Merge Format a parametrized script replacing tags with model data

func (*BucketProgram) Pid

func (instance *BucketProgram) Pid() int

func (*BucketProgram) Run

func (instance *BucketProgram) Run(args ...interface{}) (task *gg_utils.AsyncTask)

func (*BucketProgram) RunSync

func (instance *BucketProgram) RunSync(args ...interface{}) (elapsed int, response interface{}, err error)

RunSync Run program and wait

func (*BucketProgram) RunUnboxed

func (instance *BucketProgram) RunUnboxed(args ...interface{}) (out string, err error)

RunUnboxed execute the command out of a bucket wrapper

func (*BucketProgram) TryKill

func (instance *BucketProgram) TryKill() error

type BucketResourceDownloader

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

func NewBucketResourceDownloader

func NewBucketResourceDownloader(root string) (instance *BucketResourceDownloader)

func (*BucketResourceDownloader) AddResource

func (instance *BucketResourceDownloader) AddResource(remoteRawPath, localRelativePath string)

func (*BucketResourceDownloader) DownloadAll

func (instance *BucketResourceDownloader) DownloadAll(force bool) ([]string, []error)

func (*BucketResourceDownloader) SetRemoteRoot

func (instance *BucketResourceDownloader) SetRemoteRoot(remotePath string)

Jump to

Keyboard shortcuts

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