Documentation
¶
Index ¶
- Constants
- Variables
- type BuildInfo
- type Builder
- type Cache
- type Condition
- type Config
- type ConfigRunner
- type Create
- type CreateBuilder
- type CreateBuilderManager
- type Creator
- type Definition
- func (d *Definition) BinFilePath(fPath string) string
- func (d *Definition) BinName() string
- func (d *Definition) BinPath(fPath string) string
- func (d *Definition) ConfigPath(formulaPath string) string
- func (d *Definition) FormulaPath(home string) string
- func (d *Definition) TmpWorkDirPath(home string) string
- func (d *Definition) UnixBinFilePath(fPath string) string
- type Delete
- type ExecuteData
- type Executor
- type Git
- type Help
- type Input
- type InputResolver
- type InputRunner
- type Inputs
- type Items
- type Lang
- type LangCreator
- type Pattern
- type PostRunner
- type PreRunBuilder
- type PreRunChecker
- type PreRunner
- type Rename
- type Repo
- type RepoName
- type RepoProvider
- type RepoProviders
- type RepoVersion
- type Repos
- type RepositoryAddLister
- type RepositoryAdder
- type RepositoryCreateWriteListDetailDeleter
- type RepositoryCreator
- type RepositoryDeleter
- type RepositoryDetail
- type RepositoryListDetailWriter
- type RepositoryListUpdater
- type RepositoryListWriter
- type RepositoryLister
- type RepositoryPrioritySetter
- type RepositoryUpdater
- type RepositoryWriter
- type RequestInfo
- type Runner
- type RunnerType
- type Runners
- type Setup
- type TermInputTypes
- type Tree
- type TreeChecker
- type TreeGenerator
- type TreeManager
- type Workspace
- type WorkspaceAddListHasher
- type WorkspaceAddLister
- type WorkspaceAdder
- type WorkspaceDeleter
- type WorkspaceHasher
- type WorkspaceListDeleter
- type WorkspaceListHasher
- type WorkspaceListUpdater
- type WorkspaceLister
- type WorkspaceUpdater
- type Workspaces
Constants ¶
View Source
const ( ReposDir = "repos" TmpDir = "tmp" DefaultConfig = "config.json" PwdEnv = "CURRENT_PWD" CtxEnv = "CONTEXT" Env = "ENVIRONMENT" VerboseEnv = "VERBOSE_MODE" DockerExecutionEnv = "DOCKER_EXECUTION" BinUnix = "run.sh" BinWindows = "run.bat" BinDir = "bin" EnvPattern = "%s=%s" )
View Source
const ( GoLang = "Go" JavaLang = "Java" NodeLang = "Node" PhpLang = "Php" PythonLang = "Python" ShellLang = "Shell" NameBin = "{{bin-name}}" NameModule = "{{nameModule}}" NameBinFirstUpper = "{{bin-name-first-upper}}" )
View Source
const ( RepoCacheTime = 24 * time.Hour RepoCommonsName = RepoName("commons") )
View Source
const ( DefaultWorkspaceName = "Default" DefaultWorkspaceDir = "ritchie-formulas-local" WorkspacesFile = "formula_workspaces.json" )
Variables ¶
View Source
var Languages = []string{GoLang, JavaLang, NodeLang, PhpLang, PythonLang, ShellLang}
View Source
var RunnerTypes = []string{"local", "docker"}
Functions ¶
This section is empty.
Types ¶
type ConfigRunner ¶
type ConfigRunner interface { Create(runType RunnerType) error Find() (RunnerType, error) }
type Create ¶
type Create struct { FormulaCmd string `json:"formulaCmd"` Lang string `json:"lang"` Workspace Workspace `json:"workspace"` FormulaPath string `json:"formulaPath"` }
func (Create) FormulaCmdName ¶
FormulaName remove rit from formulaCmd
type CreateBuilder ¶
func NewCreateBuilder ¶
func NewCreateBuilder(creator Creator, builder Builder) CreateBuilder
type CreateBuilderManager ¶
type Definition ¶
Definition type that represents a Formula
func (*Definition) BinFilePath ¶
func (d *Definition) BinFilePath(fPath string) string
BinFilePath builds the bin file path from formula path
func (*Definition) BinName ¶
func (d *Definition) BinName() string
func (*Definition) BinPath ¶
func (d *Definition) BinPath(fPath string) string
BinFilePath builds the bin file path from formula path
func (*Definition) ConfigPath ¶
func (d *Definition) ConfigPath(formulaPath string) string
ConfigPath builds the config path from formula path and config name
func (*Definition) FormulaPath ¶
func (d *Definition) FormulaPath(home string) string
FormulaPath builds the formula path from ritchie home
func (*Definition) TmpWorkDirPath ¶
func (d *Definition) TmpWorkDirPath(home string) string
TmpWorkDirPath builds the tmp paths to run formula, first parameter is tmpDir created second parameter is tmpBinDir
func (*Definition) UnixBinFilePath ¶
func (d *Definition) UnixBinFilePath(fPath string) string
type ExecuteData ¶
type ExecuteData struct { Def Definition InType api.TermInputType RunType RunnerType Verbose bool Flags *pflag.FlagSet }
type Executor ¶
type Executor interface {
Execute(exe ExecuteData) error
}
type Input ¶
type Input struct { Name string `json:"name"` Type string `json:"type"` Default string `json:"default"` Label string `json:"label"` Items Items `json:"items"` Cache Cache `json:"cache"` Condition Condition `json:"condition"` Pattern Pattern `json:"pattern"` RequestInfo RequestInfo `json:"requestInfo"` Tutorial string `json:"tutorial"` Required *bool `json:"required"` }
type InputResolver ¶
type InputResolver interface {
Resolve(inType api.TermInputType) (InputRunner, error)
}
type InputRunner ¶
type LangCreator ¶
type PostRunner ¶
type PreRunBuilder ¶
type PreRunChecker ¶
type PreRunChecker interface {
CheckVersionCompliance() error
}
type PreRunner ¶
type PreRunner interface {
PreRun(def Definition) (Setup, error)
}
type Repo ¶
type Repo struct { Provider RepoProvider `json:"provider"` Name RepoName `json:"name"` Version RepoVersion `json:"version"` Url string `json:"url"` Token string `json:"token,omitempty"` Priority int `json:"priority"` IsLocal bool `json:"isLocal"` TreeVersion string `json:"tree_version"` LatestVersion RepoVersion `json:"latest_version"` Cache time.Time `json:"cache"` }
func (Repo) CacheExpired ¶
func (Repo) EmptyVersion ¶
func (*Repo) UpdateCache ¶
func (r *Repo) UpdateCache()
type RepoProvider ¶
type RepoProvider string
func (RepoProvider) String ¶
func (r RepoProvider) String() string
type RepoProviders ¶
type RepoProviders map[RepoProvider]Git
func NewRepoProviders ¶
func NewRepoProviders() RepoProviders
func (RepoProviders) Add ¶
func (re RepoProviders) Add(provider RepoProvider, git Git)
func (RepoProviders) List ¶
func (re RepoProviders) List() []string
func (RepoProviders) Resolve ¶
func (re RepoProviders) Resolve(provider RepoProvider) Git
type RepoVersion ¶
type RepoVersion string
func (RepoVersion) String ¶
func (r RepoVersion) String() string
type RepositoryAddLister ¶
type RepositoryAddLister interface { RepositoryAdder RepositoryLister }
type RepositoryAdder ¶
type RepositoryCreateWriteListDetailDeleter ¶
type RepositoryCreateWriteListDetailDeleter interface { RepositoryCreator RepositoryWriter RepositoryLister RepositoryDetail RepositoryDeleter }
type RepositoryCreator ¶
type RepositoryDeleter ¶
type RepositoryDetail ¶
type RepositoryListDetailWriter ¶
type RepositoryListDetailWriter interface { RepositoryLister RepositoryDetail RepositoryWriter }
type RepositoryListUpdater ¶
type RepositoryListUpdater interface { RepositoryLister RepositoryUpdater }
type RepositoryListWriter ¶
type RepositoryListWriter interface { RepositoryLister RepositoryWriter }
type RepositoryLister ¶
type RepositoryUpdater ¶
type RepositoryUpdater interface {
Update(name RepoName, version RepoVersion) error
}
type RepositoryWriter ¶
type RequestInfo ¶
type Runner ¶
type Runner interface {
Run(def Definition, inputType api.TermInputType, verbose bool, flags *pflag.FlagSet) error
}
type RunnerType ¶
type RunnerType int
const ( DefaultRun RunnerType = iota - 1 LocalRun DockerRun )
func (RunnerType) Int ¶
func (e RunnerType) Int() int
func (RunnerType) String ¶
func (e RunnerType) String() string
type Runners ¶
type Runners map[RunnerType]Runner
type TermInputTypes ¶
type TermInputTypes map[api.TermInputType]InputRunner
type TreeChecker ¶
type TreeGenerator ¶
type TreeManager ¶
type WorkspaceAddListHasher ¶
type WorkspaceAddListHasher interface { WorkspaceAdder WorkspaceLister WorkspaceHasher }
type WorkspaceAddLister ¶
type WorkspaceAddLister interface { WorkspaceAdder WorkspaceLister }
type WorkspaceAdder ¶
type WorkspaceDeleter ¶
type WorkspaceHasher ¶
type WorkspaceListDeleter ¶
type WorkspaceListDeleter interface { WorkspaceDeleter WorkspaceLister }
type WorkspaceListHasher ¶
type WorkspaceListHasher interface { WorkspaceLister WorkspaceHasher }
type WorkspaceListUpdater ¶
type WorkspaceListUpdater interface { WorkspaceLister WorkspaceUpdater }
type WorkspaceLister ¶
type WorkspaceLister interface {
List() (Workspaces, error)
}
type WorkspaceUpdater ¶
type Workspaces ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.