Documentation
¶
Index ¶
- Variables
- func CreateDirIfNotExist(path string) error
- func HasGitHubReleaseBlock(pkgs []Package) bool
- func HasSudoInCommandBuildSteps(pkgs []Package) bool
- func Validate(pkgs []Package) error
- func ValidateGHExtension(fl validator.FieldLevel) bool
- func WalkDir(path string) ([]string, error)
- type Build
- type Command
- type Config
- type GHExtension
- type Gist
- func (c Gist) Check(ctx context.Context, status chan<- Status) error
- func (c Gist) GetCommandBlock() Command
- func (c Gist) GetDependsOn() []string
- func (c Gist) GetHome() string
- func (c Gist) GetName() string
- func (c Gist) GetPluginBlock() Plugin
- func (c Gist) GetResource() state.Resource
- func (c Gist) HasCommandBlock() bool
- func (c Gist) HasPluginBlock() bool
- func (c Gist) Init() error
- func (c Gist) Install(ctx context.Context, status chan<- Status) error
- func (c Gist) Installed() bool
- func (c Gist) Uninstall(ctx context.Context) error
- type GitHub
- func (c GitHub) Check(ctx context.Context, status chan<- Status) error
- func (c GitHub) Clone(ctx context.Context) error
- func (c GitHub) GetCommandBlock() Command
- func (c GitHub) GetDependsOn() []string
- func (c GitHub) GetHome() string
- func (c GitHub) GetName() string
- func (c GitHub) GetPluginBlock() Plugin
- func (c GitHub) GetReleaseTag() string
- func (c GitHub) GetResource() state.Resource
- func (c GitHub) HasCommandBlock() bool
- func (c GitHub) HasPluginBlock() bool
- func (c GitHub) HasReleaseBlock() bool
- func (c GitHub) Init() error
- func (c GitHub) Install(ctx context.Context, status chan<- Status) error
- func (c GitHub) InstallFromRelease(ctx context.Context) error
- func (c GitHub) Installed() bool
- func (c GitHub) IsGHExtension() bool
- func (c GitHub) Uninstall(ctx context.Context) error
- type GitHubAs
- type GitHubOption
- type GitHubRelease
- type GitHubReleaseAsset
- type HTTP
- func (c HTTP) Check(ctx context.Context, status chan<- Status) error
- func (c HTTP) GetCommandBlock() Command
- func (c HTTP) GetDependsOn() []string
- func (c HTTP) GetHome() string
- func (c HTTP) GetName() string
- func (c HTTP) GetPluginBlock() Plugin
- func (c HTTP) GetResource() state.Resource
- func (c HTTP) HasCommandBlock() bool
- func (c HTTP) HasPluginBlock() bool
- func (c HTTP) Init() error
- func (c HTTP) Install(ctx context.Context, status chan<- Status) error
- func (c HTTP) Installed() bool
- func (c *HTTP) ParseURL()
- func (c HTTP) Uninstall(ctx context.Context) error
- type Handler
- type Installer
- type Link
- type Loader
- type Local
- func (c Local) Check(ctx context.Context, status chan<- Status) error
- func (c Local) GetCommandBlock() Command
- func (c Local) GetDependsOn() []string
- func (c Local) GetHome() string
- func (c Local) GetName() string
- func (c Local) GetPluginBlock() Plugin
- func (c Local) GetResource() state.Resource
- func (c Local) HasCommandBlock() bool
- func (c Local) HasPluginBlock() bool
- func (c Local) Init() error
- func (c Local) Install(ctx context.Context, status chan<- Status) error
- func (c Local) Installed() bool
- func (c Local) Uninstall(ctx context.Context) error
- type Main
- type Package
- type Plugin
- type Progress
- type Status
- type Templates
Constants ¶
This section is empty.
Variables ¶
var (
ErrPermission = errors.New("permission denied")
)
const errors
Functions ¶
func CreateDirIfNotExist ¶
func HasGitHubReleaseBlock ¶
HasGitHubReleaseBlock returns true if release block is included in one package at least
func HasSudoInCommandBuildSteps ¶
HasSudoInCommandBuildSteps returns true if sudo command is included in one build step of given package at least
func ValidateGHExtension ¶
func ValidateGHExtension(fl validator.FieldLevel) bool
Types ¶
type Build ¶
type Build struct {
Steps []string `yaml:"steps" validate:"required"`
Env map[string]string `yaml:"env"`
Directory string `yaml:"directory"`
}
Build is
type Command ¶
type Command struct {
Build *Build `yaml:"build"`
Link []*Link `yaml:"link" validate:"required"`
Env map[string]string `yaml:"env"`
Alias map[string]string `yaml:"alias"`
Snippet string `yaml:"snippet"`
If string `yaml:"if"`
}
Command is
type Config ¶
type Config struct {
GitHub []*GitHub `yaml:"github,omitempty"`
Gist []*Gist `yaml:"gist,omitempty"`
Local []*Local `yaml:"local,omitempty"`
HTTP []*HTTP `yaml:"http,omitempty"`
Main *Main `yaml:"main,omitempty"`
}
Config structure for file describing deployment. This includes the module source, inputs dependencies, backend etc. One config element is connected to a single deployment
type GHExtension ¶
type GHExtension struct {
Name string `yaml:"name" validate:"required,startswith=gh-"`
Tag string `yaml:"tag"`
RenameTo string `yaml:"rename-to" validate:"startswith-gh-if-not-empty,excludesall=/"`
}
func (GHExtension) GetHome ¶
func (gh GHExtension) GetHome() string
func (GHExtension) GetTag ¶
func (gh GHExtension) GetTag() string
func (GHExtension) Install ¶
func (gh GHExtension) Install(ctx context.Context, owner, repo, tag string) error
func (GHExtension) InstallFromRelease ¶
func (gh GHExtension) InstallFromRelease(ctx context.Context, owner, repo, tag string) error
type Gist ¶
type Gist struct {
Name string `yaml:"name" validate:"required"`
Owner string `yaml:"owner" validate:"required"`
ID string `yaml:"id" validate:"required"`
Description string `yaml:"description"`
Plugin *Plugin `yaml:"plugin"`
Command *Command `yaml:"command"`
DependsOn []string `yaml:"depends-on"`
}
Gist represents
func (Gist) GetDependsOn ¶
func (Gist) GetResource ¶
type GitHub ¶
type GitHub struct {
Name string `yaml:"name" validate:"required"`
Owner string `yaml:"owner" validate:"required"`
Repo string `yaml:"repo" validate:"required"`
Description string `yaml:"description"`
Branch string `yaml:"branch"`
Option *GitHubOption `yaml:"with"`
Release *GitHubRelease `yaml:"release"`
Plugin *Plugin `yaml:"plugin"`
Command *Command `yaml:"command" validate:"required_with=Release"` // TODO: (not required Release)
As *GitHubAs `yaml:"as"`
DependsOn []string `yaml:"depends-on"`
}
GitHub represents GitHub repository
func (GitHub) GetCommandBlock ¶
func (GitHub) GetDependsOn ¶
func (GitHub) GetPluginBlock ¶
func (GitHub) GetReleaseTag ¶
func (GitHub) GetResource ¶
func (GitHub) HasCommandBlock ¶
func (GitHub) HasPluginBlock ¶
func (GitHub) HasReleaseBlock ¶
func (GitHub) InstallFromRelease ¶
InstallFromRelease runs install from GitHub release, from not repository
func (GitHub) IsGHExtension ¶
type GitHubAs ¶
type GitHubAs struct {
GHExtension *GHExtension `yaml:"gh-extension"`
}
type GitHubOption ¶
type GitHubOption struct {
Depth int `yaml:"depth"`
}
type GitHubRelease ¶
type GitHubRelease struct {
Name string `yaml:"name" validate:"required"`
Tag string `yaml:"tag"`
Asset GitHubReleaseAsset `yaml:"asset"`
}
GitHubRelease represents a GitHub release structure
type GitHubReleaseAsset ¶
type HTTP ¶
type HTTP struct {
Name string `yaml:"name" validate:"required"`
URL string `yaml:"url" validate:"required,url"`
Description string `yaml:"description"`
Plugin *Plugin `yaml:"plugin"`
Command *Command `yaml:"command"`
DependsOn []string `yaml:"depends-on"`
Templates Templates `yaml:"templates"`
}
HTTP represents
func (HTTP) GetDependsOn ¶
func (HTTP) GetResource ¶
type Handler ¶
type Handler interface {
GetHome() string
GetName() string
HasPluginBlock() bool
HasCommandBlock() bool
GetPluginBlock() Plugin
GetCommandBlock() Command
GetDependsOn() []string
GetResource() state.Resource
}
Handler is an interface of package handler
type Installer ¶
type Installer interface {
Install(context.Context, chan<- Status) error
Uninstall(context.Context) error
Installed() bool
Check(context.Context, chan<- Status) error
}
Installer is an interface related to installation of a package
type Loader ¶
type Loader interface {
Init() error
}
Loader is an interface related to initialize a package
type Local ¶
type Local struct {
Name string `yaml:"name" validate:"required"`
Directory string `yaml:"directory" validate:"required"`
Description string `yaml:"description"`
Plugin *Plugin `yaml:"plugin"`
Command *Command `yaml:"command"`
DependsOn []string `yaml:"depends-on"`
}
Local represents
func (Local) GetDependsOn ¶
func (Local) GetResource ¶
type Main ¶
type Main struct {
Shell string `yaml:"shell"`
FilterCmd string `yaml:"filter_command"`
Env map[string]string `yaml:"env"`
}
Main represents configurations of this application itself
type Plugin ¶
type Plugin struct {
Sources []string `yaml:"sources" validate:"required"`
Env map[string]string `yaml:"env"`
Snippet string `yaml:"snippet"`
SnippetPrepare string `yaml:"snippet-prepare"`
If string `yaml:"if"`
}
Plugin is