Documentation ¶
Overview ¶
Package handlers is where the HTTP server work is done.
Index ¶
- Constants
- Variables
- func APIAddSlave(c web.C, w http.ResponseWriter, r *http.Request)
- func APIFailover(c web.C, w http.ResponseWriter, r *http.Request)
- func APIGetMaster(c web.C, w http.ResponseWriter, r *http.Request)
- func APIGetPod(c web.C, w http.ResponseWriter, r *http.Request)
- func APIGetPodMap(c web.C, w http.ResponseWriter, r *http.Request)
- func APIGetPods(c web.C, w http.ResponseWriter, r *http.Request)
- func APIGetSlaves(c web.C, w http.ResponseWriter, r *http.Request)
- func APIMonitorPod(c web.C, w http.ResponseWriter, r *http.Request)
- func APIRemovePod(c web.C, w http.ResponseWriter, r *http.Request)
- func AddNode(c web.C, w http.ResponseWriter, r *http.Request)
- func AddNodeHTMLProcessor(c web.C, w http.ResponseWriter, r *http.Request)
- func AddPodForm(c web.C, w http.ResponseWriter, r *http.Request)
- func AddPodHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func AddPodJSON(c web.C, w http.ResponseWriter, r *http.Request)
- func AddSentinelForm(c web.C, w http.ResponseWriter, r *http.Request)
- func AddSentinelHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func AddSlaveHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func AddSlaveHTMLProcessor(c web.C, w http.ResponseWriter, r *http.Request)
- func BalancePodProcessor(c web.C, w http.ResponseWriter, r *http.Request)
- func Clone(c web.C, w http.ResponseWriter, r *http.Request)
- func CloneServer(originHost, cloneHost string, promoteWhenComplete, reconfigureSlaves bool, ...) (result map[string]string)
- func CommifyFloat(bytes float64) string
- func ConstellationInfoHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func ConstellationInfoJSON(c web.C, w http.ResponseWriter, r *http.Request)
- func Dashboard(c web.C, w http.ResponseWriter, r *http.Request)
- func DoFailoverHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func DoFailoverJSON(ctx web.C, w http.ResponseWriter, r *http.Request) (err error)
- func GetNodeJSON(c web.C, w http.ResponseWriter, r *http.Request)
- func HumanizeBigBytes(bytes int64) string
- func HumanizeBytes(bytes int) string
- func HumanizeCallStats(micros float64) (res string)
- func HumanizeSlowlog(micros int64) (res string)
- func Info(c web.C, w http.ResponseWriter, r *http.Request)
- func IntFromFloat64(incoming float64) (i int)
- func OkToBool(ok string) bool
- func RebalanceHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func RebalanceJSON(c web.C, w http.ResponseWriter, r *http.Request)
- func RemovePodHTML(c web.C, w http.ResponseWriter, r *http.Request)
- func ResetPodProcessor(c web.C, w http.ResponseWriter, r *http.Request)
- func Root(c web.C, w http.ResponseWriter, r *http.Request)
- func SetConstellation(con actions.Constellation)
- func ShowNode(c web.C, w http.ResponseWriter, r *http.Request)
- func ShowNodes(c web.C, w http.ResponseWriter, r *http.Request)
- func ShowPod(c web.C, w http.ResponseWriter, r *http.Request)
- func ShowPods(c web.C, w http.ResponseWriter, r *http.Request)
- func Static(c web.C, w http.ResponseWriter, req *http.Request)
- type ErrorMetrics
- type InfoResponse
- type PageContext
Constants ¶
const STATIC_ROOT string = "html/static/"
const STATIC_URL string = "http://redskull.iamtherealbill.com/static/"
Variables ¶
var NodeMaster = new(common.NodeStore)
NodeMaster is deprecated. Previously/currently used for storing node connections. It needs refactored to use the constellation-wide node routines
var TemplateBase string
Functions ¶
func APIAddSlave ¶
APIAddSlave is the API call handler for adding a slave
func APIFailover ¶
func APIGetMaster ¶
func APIGetPodMap ¶
func APIGetPods ¶
func APIGetSlaves ¶
func APIMonitorPod ¶
func APIRemovePod ¶
func AddNode ¶
AddNode isn't currently used but would add a non-master, non-slave node. This will be refactored out to a provisioning layer
func AddNodeHTMLProcessor ¶
AddNodeHTMLProcessor is the target for the AddNode form's action
func AddPodForm ¶
AddPodForm displays the form for adding a pod
func AddPodHTML ¶
AddPodHTML is the action target for adding a pod. It does the heavy lifting
func AddPodJSON ¶
func AddSentinelForm ¶
AddSentinelForm displays the form for adding a sentinel
func AddSentinelHTML ¶
AddSentinelHTML does the heavy lifting of adding a sentinel. It is the action target for the sentinel add form
func AddSlaveHTML ¶
AddSlaveHTML shows the slave addition form
func AddSlaveHTMLProcessor ¶
AddSlaveHTMLProcessor is the action target for the AddSlaveHTML form
func BalancePodProcessor ¶
BalancePodProcessor calls the constellation's BalancePod function for the pod
func Clone ¶
Clone is not currently exposed as it comes from the first incarnation of the idea of a Redis manager. It will likely be incorporated into the pod-level handlers and exposed through that route.
func CloneServer ¶
func CloneServer(originHost, cloneHost string, promoteWhenComplete, reconfigureSlaves bool, syncTimeout float64, roleRequired string) (result map[string]string)
TODO?: rename/copy this to have MigratePodToNewPod and CloneServer ? CloneServer does the heavy lifting to clone one Redis instance to another.
func CommifyFloat ¶
CommifyFloat turns a float into a string with comma separation
func ConstellationInfoHTML ¶
func ConstellationInfoJSON ¶
func DoFailoverHTML ¶
DoFailoverHTML is how the UI initiates a failover for a pod
func DoFailoverJSON ¶
func GetNodeJSON ¶
GetNodeJSON returns the JSON output of the data known about a node
func HumanizeBigBytes ¶
HumanizeBigBytes transforms a uint64 to a human readable string such as "100Kb"
func HumanizeBytes ¶
HumanizeBytes transforms an int to a human readable string such as "100Kb"
func HumanizeCallStats ¶
HumanizeCallStats is used to convert Redis' calls stats to something humans can easily read. This means converting microseconds to milliseconds where appropriate, adding commas, and hopefully soon upconverting to seconds, minutes, hours, days, etc. where approriate
func HumanizeSlowlog ¶
HumanizeSlowlog is used to convert Redis' calls stats to something humans can easily read. This means converting microseconds to milliseconds where appropriate, adding commas, and hopefully soon upconverting to seconds, minutes, hours, days, etc. where approriate
func IntFromFloat64 ¶
IntFromFloat64 provides a convenience function fo convert an int to a float insert screed about how you probably should not do it but sometimes you need to here.
func RebalanceHTML ¶
WEB UI CALL
func RebalanceJSON ¶
func RemovePodHTML ¶
RemovePodHTML is the action target for adding a pod. It does the heavy lifting
func ResetPodProcessor ¶
ResetPodProcessor is called to reset the pod's slave&sentinel configuration
func Root ¶
Root shows the index page of Red Skull, if you didn't want to display the dashboard at the root.
func SetConstellation ¶
func SetConstellation(con actions.Constellation)
Types ¶
type ErrorMetrics ¶
type ErrorMetrics struct { NoQuorum int MissingSentinels int TooManySentinels int NoValidSlave int InvalidAuth int TotalErrorPods int ConnectionError int NoFailover int Groups map[string][]interface{} }
ErrorMetrics is a struct used by the UI to display the current breakdown of errors among the pod.
type InfoResponse ¶
InfoResponse represents the information returned in an API call
type PageContext ¶
type PageContext struct { Title string SubTitle string Data interface{} Static string ViewTemplate string CurrentURL string Constellation *actions.Constellation NodeMaster common.NodeManager Pod *common.RedisPod Node *common.RedisNode Refresh bool RefreshTime int RefreshURL string Error error }
PageContext holds all the contextual information a page will want to return, use, or display
func NewPageContext ¶
func NewPageContext() (pc PageContext, err error)
NewPageContext instantiates and returns a PageContext with "global" data already set.