Documentation ¶
Index ¶
- Variables
- func Connect() (*consul.Client, error)
- func Get(c *consul.Client, key string) string
- func Log(message, priority string)
- func RunTime(start time.Time, location, extra string)
- func Set(c *consul.Client, key, value string) bool
- func StatsdBlank(watchType string)
- func StatsdDuplicate(watchType string, watchID string)
- func StatsdRunTime(start time.Time, exec string, watchType string, watchID string, id string)
- type EventWatch
- type KeyWatch
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Exec is the command that should be executed if there's a watch that actually fires. Exec string // Token is used for access to Consul if an ACL is being used. Token string // DogStatsd sends metrics to Dogstatsd if set to true. DogStatsd bool // Prefix is the location in Consul's KV store to keep state information. Prefix string // MetricPrefix is the prefix for all Sifter metrics. MetricPrefix string // ConsulServer is where we want to connect to Consul. ConsulServer string )
View Source
var RootCmd = &cobra.Command{ Use: "sifter", Short: "Make sure that a Consul watch only fires when it's appropriate.", Long: `When Consul loads watches, it often fires them with a blank JSON array. sifter makes sure there's an actual JSON entity present, that it's new and then runs your command.`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("`sifter -h` for help information.") }, }
RootCmd sets up all fo the other commands.
Functions ¶
func StatsdBlank ¶
func StatsdBlank(watchType string)
StatsdBlank sends Dogstatsd metrics whenever there's a blank watch.
func StatsdDuplicate ¶
StatsdDuplicate sends Dogstatsd metrics whenever there's a duplicate watch.
Types ¶
type EventWatch ¶
type EventWatch struct { ID string `json:"ID"` Name string `json:"Name"` Payload string `json:"Payload,omitempty"` NodeFilter string `json:"NodeFilter,omitempty"` ServiceFilter string `json:"ServiceFilter"` TagFilter string `json:"TagFilter"` Version int `json:"Version"` LTime int `json:"LTime"` }
EventWatch is the JSON structure of a Consul Event.
type KeyWatch ¶
type KeyWatch struct { CreateIndex int `json:"CreateIndex"` Flags int `json:"Flags,omitempty"` Key string `json:"Key"` LockIndex int `json:"LockIndex,omitempty"` ModifyIndex int `json:"ModifyIndex"` Session string `json:"Session,omitempty"` Value string `json:"Value"` }
KeyWatch is the JSON structure of a Consul key watch.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.