Documentation ¶
Index ¶
Constants ¶
View Source
const ( StateFileFolder = "cache" StateFileCharReplacer = "-" )
Variables ¶
View Source
var ( StateFileRegex = regexp.MustCompile(`[\/\?<>\\:\*\|":!\s.]`) StateFileRegexDashes = regexp.MustCompile(`--+`) )
partly based on https://github.com/parshap/node-sanitize-filename/blob/master/index.js
Functions ¶
func AccessLogger ¶
func AccessLogger() restful.FilterFunction
func SetupSelfdiagnose ¶
func SetupSelfdiagnose(app *restful.WebService)
Types ¶
type Bot ¶
type Bot interface { Name() string Description() string Help() Reply HandleMessage(*webhook.Request) Reply HandleConfig(*Wrangler, json.RawMessage) error CurrentState() []byte }
Bot is the interface for the small bots used by the wrangler
type HipchatConfig ¶
type HipchatConfig struct { URL string `json:"url"` BotAuth string `json:"bot_auth"` ScopeAuth string `json:"scope_auth"` DefaultRoom string `json:"room_id"` }
HipchatConfig is the struct used to marshall the "hipchat" part of the JSON configuration
type Reply ¶
type Reply struct { Notification hipchat.NotificationRequest Replying bool }
func NewReply ¶
func NewReply(n hipchat.NotificationRequest) Reply
type ReportBuildAndDate ¶
func (ReportBuildAndDate) Comment ¶
func (r ReportBuildAndDate) Comment() string
func (ReportBuildAndDate) Run ¶
func (r ReportBuildAndDate) Run(ctx *selfdiagnose.Context, result *selfdiagnose.Result)
type ReportHTTPRequest ¶
type ReportHTTPRequest struct{}
func (ReportHTTPRequest) Comment ¶
func (r ReportHTTPRequest) Comment() string
func (ReportHTTPRequest) Run ¶
func (r ReportHTTPRequest) Run(ctx *selfdiagnose.Context, result *selfdiagnose.Result)
type ReportHostname ¶
type ReportHostname struct{}
func (ReportHostname) Comment ¶
func (r ReportHostname) Comment() string
func (ReportHostname) Run ¶
func (r ReportHostname) Run(ctx *selfdiagnose.Context, result *selfdiagnose.Result)
type Wrangler ¶
type Wrangler struct {
// contains filtered or unexported fields
}
Wrangler is the object that holds the configuration, HipChat client and has several general methods
func NewSnaketrap ¶
NewSnaketrap reads the config.json and returns a bootstrapped Wrangler and listen address.
func (*Wrangler) GetBotConfig ¶
func (w *Wrangler) GetBotConfig() json.RawMessage
func (*Wrangler) SendNotification ¶
func (w *Wrangler) SendNotification(b Bot, n *hipchat.NotificationRequest)
Click to show internal directories.
Click to hide internal directories.