uchiwa

package
v0.0.0-...-2890255 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Health = health{Uchiwa: "ok", Sensu: make(map[string]interface{})}

Health contains the health of Uchiwa and every Sensu API

View Source
var Results = new(results)

Results is a results struct that contains all Sensu APIs data

Functions

func Build

func Build(dcSlice *[]sensu.Sensu)

Build retrieves all endpoints for every API

func BuildClients

func BuildClients()

BuildClients constructs clients objects for frontend consumption

func BuildEvents

func BuildEvents()

BuildEvents constructs events objects for frontend consumption

func BuildSubscriptions

func BuildSubscriptions()

BuildSubscriptions builds a slice of every client subscriptions

func CreateStash

func CreateStash(data interface{}) error

CreateStash send a POST request to the /stashes endpoint in order to create a stash

func DeleteClient

func DeleteClient(id string, dc string) error

DeleteClient send a DELETE request to the /clients/*client* endpoint in order to delete a client

func DeleteStash

func DeleteStash(data interface{}) error

DeleteStash send a DELETE request to the /stashes/*path* endpoint in order to delete a stash

func Fetch

func Fetch(t int)

Fetch retrieves data from each API every t seconds

func GetClient

func GetClient(id string, dc string) (map[string]interface{}, error)

GetClient retrieves client history from specified DC

func New

func New(c *Config) *[]sensu.Sensu

New initialize all Sensu APIs

func ResolveEvent

func ResolveEvent(data interface{}) error

ResolveEvent send a POST request to the /resolve endpoint in order to resolve an event

func Status

func Status(info map[string]interface{}, name string) map[string]string

Status build each DC status

func WebServer

func WebServer(config *Config, publicPath *string)

WebServer starts the web server and serves GET & POST requests

Types

type Config

type Config struct {
	Sensu  []SensuConfig
	Uchiwa GlobalConfig
}

Config struct contains []SensuConfig and UchiwaConfig structs

var PublicConfig *Config

PublicConfig contains the public configuration of Uchiwa (hidden user & pass)

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig function loads a specified configuration file and return a Config struct

type GlobalConfig

type GlobalConfig struct {
	Host    string
	Port    int
	Refresh int
	Pass    string
	User    string
}

GlobalConfig struct contains conf about Uchiwa

type SensuConfig

type SensuConfig struct {
	Name    string
	Host    string
	Port    int
	Ssl     bool
	URL     string
	User    string
	Path    string
	Pass    string
	Timeout int
}

SensuConfig struct contains conf about a Sensu API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL