Documentation ¶
Index ¶
- Variables
- func DistinctStrings(elems ...string) []string
- func GetPathOfSelf() (dir string, err error)
- func GzipCompress(in []byte) (out []byte, err error)
- func GzipDecompress(in []byte) (out []byte, err error)
- func RandomString(size int, charset []rune) string
- func ToStruct(v map[string]interface{}) *st.Struct
- func ToValue(v interface{}) *st.Value
- type BashScriptStage
- type BashScriptsExecutor
- func (e *BashScriptsExecutor) AddEnv(env ...string) *BashScriptsExecutor
- func (e *BashScriptsExecutor) AddScriptsInStage(name string, scripts ...string) *BashScriptsExecutor
- func (e *BashScriptsExecutor) AddStage(stage *BashScriptStage) *BashScriptsExecutor
- func (e *BashScriptsExecutor) EncodedScript() string
- func (e *BashScriptsExecutor) Perform() ([]byte, error)
- func (e *BashScriptsExecutor) SetEnv(env ...string) *BashScriptsExecutor
- type FairQueue
- type SingletonDesc
- type WaitGroupWithState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CharsetCharUpperCase = []rune("ABCDEFGHIJKLMNOPARSTUVWXYZ") CharsetCharLowerCase = []rune("abcdefghijklmnopqrstuvwxyz") CharsetChars = append(CharsetCharUpperCase, CharsetCharLowerCase...) CharsetDigit = []rune("0123456789") CharsetCharDigit = append(CharsetChars, CharsetDigit...) CharsetHex = []rune("0123456789abcdef") )
Functions ¶
func DistinctStrings ¶
func GetPathOfSelf ¶
func GzipCompress ¶
func GzipDecompress ¶
func RandomString ¶
Types ¶
type BashScriptStage ¶
func NewBashScriptStage ¶
func NewBashScriptStage(name string, scripts ...string) *BashScriptStage
func (*BashScriptStage) AddScripts ¶
func (e *BashScriptStage) AddScripts(scripts ...string) *BashScriptStage
func (*BashScriptStage) EncodedScripts ¶
func (e *BashScriptStage) EncodedScripts(job string) []string
func (*BashScriptStage) SetScripts ¶
func (e *BashScriptStage) SetScripts(scripts ...string) *BashScriptStage
type BashScriptsExecutor ¶
type BashScriptsExecutor struct { Id string Env []string Stages []BashScriptStage }
func NewBashScriptsExecutor ¶
func NewBashScriptsExecutor(id string, env ...string) *BashScriptsExecutor
func (*BashScriptsExecutor) AddEnv ¶
func (e *BashScriptsExecutor) AddEnv(env ...string) *BashScriptsExecutor
func (*BashScriptsExecutor) AddScriptsInStage ¶
func (e *BashScriptsExecutor) AddScriptsInStage(name string, scripts ...string) *BashScriptsExecutor
func (*BashScriptsExecutor) AddStage ¶
func (e *BashScriptsExecutor) AddStage(stage *BashScriptStage) *BashScriptsExecutor
func (*BashScriptsExecutor) EncodedScript ¶
func (e *BashScriptsExecutor) EncodedScript() string
func (*BashScriptsExecutor) Perform ¶
func (e *BashScriptsExecutor) Perform() ([]byte, error)
func (*BashScriptsExecutor) SetEnv ¶
func (e *BashScriptsExecutor) SetEnv(env ...string) *BashScriptsExecutor
type FairQueue ¶
type FairQueue struct {
// contains filtered or unexported fields
}
*
- Fair Queue:
- a fifo queue, which is used to help us schedule the
- sequence of execution *
- It could also treated as some kind of Lock
func NewFairQueue ¶
func NewFairQueue() *FairQueue
func (*FairQueue) Close ¶
func (q *FairQueue) Close()
It's OK to leave a Go channel open forever and never close it. When the channel is no longer used, it will be garbage collected. -- <https://stackoverflow.com/questions/8593645> However we could provide a close + wait interface, which is used to indicate its finishing
type SingletonDesc ¶
type SingletonDesc struct {
// contains filtered or unexported fields
}
*
- SingletonDesc provides a simple way to **SKIP** one function
- If another function is in executing
func NewSingleton ¶
func NewSingleton() *SingletonDesc
func (*SingletonDesc) Acquire ¶
func (s *SingletonDesc) Acquire(f func())
type WaitGroupWithState ¶
type WaitGroupWithState struct {
// contains filtered or unexported fields
}
func NewWaitGroupWithState ¶
func NewWaitGroupWithState() *WaitGroupWithState
func (*WaitGroupWithState) Add ¶
func (wg *WaitGroupWithState) Add(delta int64) int64
func (*WaitGroupWithState) Done ¶
func (wg *WaitGroupWithState) Done() int64
func (*WaitGroupWithState) State ¶
func (wg *WaitGroupWithState) State() int64
func (*WaitGroupWithState) Wait ¶
func (wg *WaitGroupWithState) Wait()
Click to show internal directories.
Click to hide internal directories.