Documentation
¶
Index ¶
- Variables
- func IsEmpty(i interface{}) bool
- func NewMail(c *MailConfig) core.Middleware
- func NewOverlap(c *OverlapConfig) core.Middleware
- func NewSave(c *SaveConfig) core.Middleware
- func NewSlack(c *SlackConfig) core.Middleware
- func SanitizeFilename(filename string) string
- func SanitizeJobName(jobName string) string
- func SanitizePath(path string) string
- type Mail
- type MailConfig
- type Overlap
- type OverlapConfig
- type PathSanitizer
- type Save
- type SaveConfig
- type Slack
- type SlackConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultSanitizer = NewPathSanitizer()
Default sanitizer instance
Functions ¶
func NewMail ¶
func NewMail(c *MailConfig) core.Middleware
NewMail returns a Mail middleware if the given configuration is not empty
func NewOverlap ¶
func NewOverlap(c *OverlapConfig) core.Middleware
NewOverlap returns a Overlap middleware if the given configuration is not empty
func NewSave ¶
func NewSave(c *SaveConfig) core.Middleware
NewSave returns a Save middleware if the given configuration is not empty
func NewSlack ¶
func NewSlack(c *SlackConfig) core.Middleware
NewSlack returns a Slack middleware if the given configuration is not empty
func SanitizeFilename ¶ added in v0.10.1
SanitizeFilename is a convenience function using the default sanitizer
func SanitizeJobName ¶ added in v0.10.1
SanitizeJobName is a convenience function using the default sanitizer
func SanitizePath ¶ added in v0.10.1
SanitizePath is a convenience function using the default sanitizer
Types ¶
type Mail ¶
type Mail struct {
MailConfig
}
Mail middleware delivers a email just after an execution finishes
func (*Mail) ContinueOnStop ¶
ContinueOnStop always returns true; we always want to report the final status
type MailConfig ¶
type MailConfig struct {
SMTPHost string `gcfg:"smtp-host" mapstructure:"smtp-host"`
SMTPPort int `gcfg:"smtp-port" mapstructure:"smtp-port"`
SMTPUser string `gcfg:"smtp-user" mapstructure:"smtp-user" json:"-"`
SMTPPassword string `gcfg:"smtp-password" mapstructure:"smtp-password" json:"-"`
SMTPTLSSkipVerify bool `gcfg:"smtp-tls-skip-verify" mapstructure:"smtp-tls-skip-verify"`
EmailTo string `gcfg:"email-to" mapstructure:"email-to"`
EmailFrom string `gcfg:"email-from" mapstructure:"email-from"`
MailOnlyOnError bool `gcfg:"mail-only-on-error" mapstructure:"mail-only-on-error"`
}
MailConfig configuration for the Mail middleware
type Overlap ¶
type Overlap struct {
OverlapConfig
}
Overlap when this middleware is enabled avoid to overlap executions from a specific job
func (*Overlap) ContinueOnStop ¶
ContinueOnStop Overlap is only called if the process is still running
type OverlapConfig ¶
type OverlapConfig struct {
NoOverlap bool `gcfg:"no-overlap" mapstructure:"no-overlap"`
}
OverlapConfig configuration for the Overlap middleware
type PathSanitizer ¶ added in v0.10.1
type PathSanitizer struct {
// contains filtered or unexported fields
}
PathSanitizer provides secure path sanitization utilities
func NewPathSanitizer ¶ added in v0.10.1
func NewPathSanitizer() *PathSanitizer
NewPathSanitizer creates a new path sanitizer with security rules
func (*PathSanitizer) SanitizeFilename ¶ added in v0.10.1
func (ps *PathSanitizer) SanitizeFilename(filename string) string
SanitizeFilename sanitizes a filename for safe file system operations
func (*PathSanitizer) SanitizeJobName ¶ added in v0.10.1
func (ps *PathSanitizer) SanitizeJobName(jobName string) string
SanitizeJobName sanitizes a job name for use in filenames
func (*PathSanitizer) SanitizePath ¶ added in v0.10.1
func (ps *PathSanitizer) SanitizePath(path string) string
SanitizePath sanitizes a path to prevent directory traversal and injection
func (*PathSanitizer) ValidateSaveFolder ¶ added in v0.10.1
func (ps *PathSanitizer) ValidateSaveFolder(folder string) error
ValidateSaveFolder validates that a save folder path is safe to use
type Save ¶
type Save struct {
SaveConfig
}
Save the save middleware saves to disk a dump of the stdout and stderr after every execution of the process
func (*Save) ContinueOnStop ¶
ContinueOnStop always returns true; we always want to report the final status
type SaveConfig ¶
type SaveConfig struct {
SaveFolder string `gcfg:"save-folder" mapstructure:"save-folder"`
SaveOnlyOnError bool `gcfg:"save-only-on-error" mapstructure:"save-only-on-error"`
}
SaveConfig configuration for the Save middleware
type Slack ¶
type Slack struct {
SlackConfig
Client *http.Client
}
Slack middleware calls to a Slack input-hook after every execution of a job
func (*Slack) ContinueOnStop ¶
ContinueOnStop always returns true; we always want to report the final status
type SlackConfig ¶
type SlackConfig struct {
SlackWebhook string `gcfg:"slack-webhook" mapstructure:"slack-webhook" json:"-"`
SlackOnlyOnError bool `gcfg:"slack-only-on-error" mapstructure:"slack-only-on-error"`
}
SlackConfig configuration for the Slack middleware