Documentation
¶
Overview ¶
MIT License
Copyright (c) 2021 Rally Health, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License ¶
Copyright (c) 2021 Rally Health, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License ¶
Copyright (c) 2021 Rally Health, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License ¶
Copyright (c) 2021 Rally Health, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func AutoLocateJob(args []string, branch string, Jenky *gojenkins.Jenkins) (*gojenkins.Job, string)
- func BatchScript(requests []*http.Request, concurrencyLimit int) []result
- func BuildJobIndex(Jenky *gojenkins.Jenkins)
- func BuildScriptRequest(J *gojenkins.Jenkins, team string, script string) *http.Request
- func FindCurrentRepoJobs() []string
- func FollowBuild(B *gojenkins.Build)
- func GenerateParameterList(jobBatch BatchJob) []map[string]string
- func GetAffiliatedJobs(url string) []string
- func GetBuild(J *gojenkins.Jenkins, path string, num int64) *gojenkins.Build
- func GetCurrentBranch() string
- func GetCurrentGitRepo() string
- func GetCurrentPROfBranch() string
- func GetInnerJobs(J *gojenkins.Jenkins, job *gojenkins.Job) []*gojenkins.Job
- func GetJobParameters(J *gojenkins.Jenkins, path string) map[string]gojenkins.ParameterDefinition
- func GetJobs(J *gojenkins.Jenkins) []*gojenkins.Job
- func GetNestedJob(J *gojenkins.Jenkins, path string) (*gojenkins.Job, error)
- func InvokeBatchJob(Jenky *gojenkins.Jenkins, jobBatch BatchJob) error
- func InvokeJob(Jenky *gojenkins.Jenkins, thejob *gojenkins.Job, choices map[string]string)
- func IsGitDirectory() bool
- func RefreshJobIndex(j *gojenkins.Jenkins)
- func RunJobList(j JobList, Jenky *gojenkins.Jenkins) error
- func RunScript(J *gojenkins.Jenkins, team string, script string) (string, error)
- func ValidateBatchJob(jl JobList) bool
- type BatchJob
- type Build
- type Hue
- type JobIndex
- type JobList
- type RegexpWriter
- func (w *RegexpWriter) AddRule(h *Hue, re *regexp.Regexp)
- func (w *RegexpWriter) AddRuleString(h *Hue, s string)
- func (w *RegexpWriter) AddRuleStringPOSIX(h *Hue, s string)
- func (w *RegexpWriter) FlushRules()
- func (w *RegexpWriter) PrintRules()
- func (w RegexpWriter) Write(p []byte) (n int, err error)
- func (w RegexpWriter) WriteString(s string) (n int, err error)
- type String
- type Writer
Constants ¶
const ( Black = iota + 30 Red Green Brown // Looks more like yellow on most terminal emulators Blue Magenta Cyan White Underline Default )
Foreground color codes
const ( First = Black Last = White )
For iterating through all color codes
const ( // ASCIIFmt is a format specifer for a ECMA-48 color string ASCIIFmt = "\033[%d;%dm" // ASCIIReset is a reset code that restores the colors to their defaults ASCIIReset = "\033[0m" // ASCIIFmtReset is a combination of ASCIIFmt and ASCIIReset with a value is sandwiched in between. ASCIIFmtReset = "\033[%d;%dm%v\033[0m" // fmt.Sprintf can't accept arguments in the form fmt.Sprintf("%s %s %s %s", "a", "b", []interface{ "c", "d"}...) // see Encode for the workaround that uses this constant ASCIIFmtFmtReset = "\033[%d;%dm%%v\033[0m" )
const Query = `` /* 485-byte string literal not displayed */
Variables ¶
var HueToString = map[int]string{ Black: "black", Blue: "blue", Brown: "brown", Cyan: "cyan", Default: "default", Green: "green", Magenta: "magenta", Red: "red", White: "white", }
HueToString is a map of hue color codes to their names
var StringToHue = map[string]int{ "black": Black, "blue": Blue, "brown": Brown, "cyan": Cyan, "default": Default, "green": Green, "magenta": Magenta, "red": Red, "white": White, }
StringToHue is a map of hue strings to color codes
Functions ¶
func AutoLocateJob ¶
func BatchScript ¶
boundedParallelGet sends requests in parallel but only up to a certain limit, and furthermore it's only parallel up to the amount of CPUs but is always concurrent up to the concurrency limit
func BuildJobIndex ¶
func BuildScriptRequest ¶
func FindCurrentRepoJobs ¶
func FindCurrentRepoJobs() []string
func FollowBuild ¶
func GenerateParameterList ¶
func GetAffiliatedJobs ¶
func GetCurrentBranch ¶
func GetCurrentBranch() string
func GetCurrentGitRepo ¶
func GetCurrentGitRepo() string
func GetCurrentPROfBranch ¶
func GetCurrentPROfBranch() string
func GetJobParameters ¶
func IsGitDirectory ¶
func IsGitDirectory() bool
func RefreshJobIndex ¶
func ValidateBatchJob ¶
Types ¶
type Build ¶
func ParseBuildPath ¶
type Hue ¶
type Hue struct {
// contains filtered or unexported fields
}
Hue holds the foreground color and background color as integers
func (*Hue) Print ¶
func (h *Hue) Print(a ...interface{})
Print behaves like fmt.Print, except it colorizes the output
type JobList ¶
type JobList struct {
Batch []BatchJob `yaml:"BatchJobs"`
}
func ReadBatchJob ¶
func ReadBatchJobFile ¶
type RegexpWriter ¶
type RegexpWriter struct {
// contains filtered or unexported fields
}
RegexpWriter implements colorization for a io.Writer object by processing a set of rules. Rules are hue objects assocated with regular expressions.
func NewRegexpWriter ¶
func NewRegexpWriter(w io.Writer) *RegexpWriter
NewRegexpWriter returns a new RegexpWriter
func (*RegexpWriter) AddRule ¶
func (w *RegexpWriter) AddRule(h *Hue, re *regexp.Regexp)
AddRule binds a hue to a regular expression.
func (*RegexpWriter) AddRuleString ¶
func (w *RegexpWriter) AddRuleString(h *Hue, s string)
AddRuleString binds a hue to the regexp in the string 's'. Similar to AddRule, except the caller passes in an uncompiled regexp.
func (*RegexpWriter) AddRuleStringPOSIX ¶
func (w *RegexpWriter) AddRuleStringPOSIX(h *Hue, s string)
AddRuleStringPOSIX binds a hue to the POSIX regexp in the string 's'. Similar to AddRule, except the caller passes in an uncompiled POSIX regexp.
func (*RegexpWriter) FlushRules ¶
func (w *RegexpWriter) FlushRules()
FlushRules deletes all rules added with AddRule from Writer
func (*RegexpWriter) PrintRules ¶
func (w *RegexpWriter) PrintRules()
PrintRules prints out the rules
func (RegexpWriter) Write ¶
func (w RegexpWriter) Write(p []byte) (n int, err error)
Write writes the contents of p into the buffer after processesing the regexp rules added to Writer with AddRule. Write colorizes the contents as it writes to the underlying writer object.
func (RegexpWriter) WriteString ¶
func (w RegexpWriter) WriteString(s string) (n int, err error)
WriteString is similar to Write, except it writes a string to the underlying buffer instead of a byte slice.
type String ¶
type String string
String is a string containing ECMA-48 color codes. Its purpose is to remind the user at compile time that it differs from the string builtin.
type Writer ¶
type Writer struct { *Hue // contains filtered or unexported fields }
Writer implements colorization for an underlying io.Writer object