Documentation ¶
Index ¶
- func CheckoutToExistingBranch(branch, path string) bool
- func CheckoutToNewBranch(branch, path string) bool
- func DoesGitRepoExist(path string) bool
- func FinalizeUpdates(cookbookName, path, version string, ui UI) bool
- func GetConfigPath(fileName string) string
- func GetCurrentBranch(path string) string
- func GetDefaultConfigPath() string
- func GetDefaultCookbookPath() (string, error)
- func IsBranchExists(branch, path string) bool
- func IsUnCommittedWorkPresent(path string) (bool, string)
- func MergeUpdates(cookbookName, path, version string, ui UI)
- func SanityCheck(path, defaultBranch string, useCurrentBranch bool, ui UI) bool
- func UpdateCount(cookbookName, path string) int
- type Config
- type JsonPresenter
- func (jp *JsonPresenter) DisplayCookBook(data interface{}) interface{}
- func (jp *JsonPresenter) Format(data interface{}) string
- func (jp *JsonPresenter) FormatSubSet(data string) string
- func (jp *JsonPresenter) ListDisplay(config Config, data interface{}) interface{}
- func (jp *JsonPresenter) NameOrID(data map[string]interface{}) interface{}
- func (jp *JsonPresenter) NestedValue(data interface{}) interface{}
- func (jp *JsonPresenter) Summarize(data string) string
- type Presenter
- type TextPresenter
- func (tp *TextPresenter) DisplayCookBook(data interface{}) interface{}
- func (tp *TextPresenter) Format(data interface{}) string
- func (tp *TextPresenter) FormatSubSet(data string) string
- func (tp *TextPresenter) ListDisplay(config Config, data interface{}) interface{}
- func (tp *TextPresenter) NameOrID(data map[string]interface{}) interface{}
- func (tp *TextPresenter) NestedValue(data interface{}) interface{}
- func (tp *TextPresenter) Summarize(data string) string
- type UI
- func (u *UI) AskQuestion(config Config, question string, opts map[string]string) (ans string)
- func (u *UI) ColorMsg(message, color string) string
- func (u *UI) Confirm(config Config, question string, appendInstructions bool, defaultChoice int)
- func (u *UI) ConfirmWithoutExit(config Config, question string, appendInstructions bool, defaultChoice int) bool
- func (u *UI) ConfirmationInstructions(defaultChoice int) string
- func (u *UI) Debug(message string)
- func (u *UI) Error(message string)
- func (u *UI) Fatal(message string)
- func (u *UI) Msg(message string)
- func (u *UI) Output(config Config, data interface{})
- func (u *UI) Warn(message string)
- type YamlPresenter
- func (yp *YamlPresenter) DisplayCookBook(data interface{}) interface{}
- func (yp *YamlPresenter) Format(data interface{}) string
- func (yp *YamlPresenter) FormatSubSet(data string) string
- func (yp *YamlPresenter) ListDisplay(config Config, data interface{}) interface{}
- func (yp *YamlPresenter) NameOrID(data map[string]interface{}) interface{}
- func (yp *YamlPresenter) NestedValue(data interface{}) interface{}
- func (yp *YamlPresenter) Summarize(data string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutToNewBranch ¶
func DoesGitRepoExist ¶
func FinalizeUpdates ¶
func GetConfigPath ¶
GetConfigPath will return default config path from current dir
func GetCurrentBranch ¶
func GetDefaultConfigPath ¶
func GetDefaultConfigPath() string
GetDefaultConfigPath will return default config path from /etc/chef
func GetDefaultCookbookPath ¶ added in v0.0.4
GetDefaultCookbookPath will return default config path from /etc/chef
func IsBranchExists ¶
func MergeUpdates ¶
func UpdateCount ¶
Types ¶
type Config ¶
type Config struct { ServerUrl string `json:"server_url" yaml:"server_url"` ClientKey string `json:"client_key" yaml:"client_key"` ConfigFile string `json:"config_file" yaml:"config_file"` DefaultValue bool `json:"default_value" yaml:"default_value"` Format string `json:"format" yaml:"format"` SuperMarketSite string `json:"super_market_site" yaml:"super_market_site"` Version string `json:"version" yaml:"version"` Yes bool `json:"yes" yaml:"yes"` WithUri string `json:"with_uri" yaml:"with_uri"` }
Config this will contain all configuration required by chef command like chef infra server url, Chef zero host url and port Chef Infra Server client key format etc ...
type JsonPresenter ¶
type JsonPresenter struct {
// contains filtered or unexported fields
}
func NewJsonPresenter ¶
func NewJsonPresenter(separator, attr, runList string) *JsonPresenter
func (*JsonPresenter) DisplayCookBook ¶
func (jp *JsonPresenter) DisplayCookBook(data interface{}) interface{}
DisplayCookBook will display cookbook in given format
func (*JsonPresenter) Format ¶
func (jp *JsonPresenter) Format(data interface{}) string
Format will format in pretty print
func (*JsonPresenter) FormatSubSet ¶
func (jp *JsonPresenter) FormatSubSet(data string) string
FormatSubSet will separate data on give input
func (*JsonPresenter) ListDisplay ¶
func (jp *JsonPresenter) ListDisplay(config Config, data interface{}) interface{}
ListDisplay list display sort tje list and print result
func (*JsonPresenter) NameOrID ¶
func (jp *JsonPresenter) NameOrID(data map[string]interface{}) interface{}
NameOrID will print name or id
func (*JsonPresenter) NestedValue ¶
func (jp *JsonPresenter) NestedValue(data interface{}) interface{}
NestedValue will get all nested value matching to attr
func (*JsonPresenter) Summarize ¶
func (jp *JsonPresenter) Summarize(data string) string
Summarize Summarize given input
type Presenter ¶
type Presenter interface { Format(data interface{}) string Summarize(data string) string ListDisplay(config Config, data interface{}) interface{} FormatSubSet(data string) string NameOrID(data map[string]interface{}) interface{} NestedValue(data interface{}) interface{} DisplayCookBook(data interface{}) interface{} }
type TextPresenter ¶
type TextPresenter struct {
// contains filtered or unexported fields
}
func NewTextPresenter ¶
func NewTextPresenter(separator, attr, runList string) *TextPresenter
func (*TextPresenter) DisplayCookBook ¶
func (tp *TextPresenter) DisplayCookBook(data interface{}) interface{}
DisplayCookBook will display cookbook in given format
func (*TextPresenter) Format ¶
func (tp *TextPresenter) Format(data interface{}) string
Format will format in pretty print
func (*TextPresenter) FormatSubSet ¶
func (tp *TextPresenter) FormatSubSet(data string) string
FormatSubSet will separate data on give input
func (*TextPresenter) ListDisplay ¶
func (tp *TextPresenter) ListDisplay(config Config, data interface{}) interface{}
ListDisplay list display sort tje list and print result
func (*TextPresenter) NameOrID ¶
func (tp *TextPresenter) NameOrID(data map[string]interface{}) interface{}
NameOrID will print name or id
func (*TextPresenter) NestedValue ¶
func (tp *TextPresenter) NestedValue(data interface{}) interface{}
NestedValue will get all nested value matching to attr
func (*TextPresenter) Summarize ¶
func (tp *TextPresenter) Summarize(data string) string
Summarize Summarize given input
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI will used to display current output in format and color
func (*UI) AskQuestion ¶
func (*UI) ConfirmWithoutExit ¶
func (u *UI) ConfirmWithoutExit(config Config, question string, appendInstructions bool, defaultChoice int) bool
ConfirmWithoutExit ask user question based on that program continue
func (*UI) ConfirmationInstructions ¶
ConfirmationInstructions instruction shown to user
type YamlPresenter ¶
type YamlPresenter struct {
// contains filtered or unexported fields
}
func NewYamlPresenter ¶
func NewYamlPresenter(separator, attr, runList string) *YamlPresenter
func (*YamlPresenter) DisplayCookBook ¶
func (yp *YamlPresenter) DisplayCookBook(data interface{}) interface{}
DisplayCookBook will display cookbook in given format
func (*YamlPresenter) Format ¶
func (yp *YamlPresenter) Format(data interface{}) string
Format will format in pretty print
func (*YamlPresenter) FormatSubSet ¶
func (yp *YamlPresenter) FormatSubSet(data string) string
FormatSubSet will separate data on give input
func (*YamlPresenter) ListDisplay ¶
func (yp *YamlPresenter) ListDisplay(config Config, data interface{}) interface{}
ListDisplay list display sort tje list and print result
func (*YamlPresenter) NameOrID ¶
func (yp *YamlPresenter) NameOrID(data map[string]interface{}) interface{}
NameOrID will print name or id
func (*YamlPresenter) NestedValue ¶
func (yp *YamlPresenter) NestedValue(data interface{}) interface{}
NestedValue will get all nested value matching to attr
func (*YamlPresenter) Summarize ¶
func (yp *YamlPresenter) Summarize(data string) string
Summarize Summarize given input