Documentation ¶
Index ¶
- Variables
- func GetRoleFromToken(token *jwt.Token) (*auth.Role, error)
- func MergeStringSlices(a1, a2 []string) []string
- func SliceIntersection(a1, a2 []string) bool
- type Uchiwa
- func (u *Uchiwa) DeleteCheckResult(check, client, dc string) error
- func (u *Uchiwa) DeleteClient(id string, dc string) error
- func (u *Uchiwa) DeleteStash(dc, path string) error
- func (u *Uchiwa) GetAggregate(check string, dc string) (*[]interface{}, error)
- func (u *Uchiwa) GetAggregateByIssued(check string, issued string, dc string) (*map[string]interface{}, error)
- func (u *Uchiwa) GetClient(client, dc string) (map[string]interface{}, error)
- func (u *Uchiwa) IssueCheckExecution(data structs.CheckExecution) error
- func (u *Uchiwa) PostStash(data stash) error
- func (u *Uchiwa) ResolveEvent(check, client, dc string) error
- func (u *Uchiwa) WebServer(publicPath *string, auth auth.Config)
Constants ¶
This section is empty.
Variables ¶
var FilterAggregates func(aggregates *[]interface{}, token *jwt.Token) []interface{}
FilterAggregates is a function that filters aggregates
var FilterChecks func(checks *[]interface{}, token *jwt.Token) []interface{}
FilterChecks is a function that filters checks
var FilterClients func(clients *[]interface{}, token *jwt.Token) []interface{}
FilterClients is a function that filters clients
var FilterDatacenters func(datacenters []*structs.Datacenter, token *jwt.Token) []*structs.Datacenter
FilterAggregates is a function that filters datacenters
var FilterEvents func(events *[]interface{}, token *jwt.Token) []interface{}
FilterEvents is a function that filters events
var FilterGetRequest func(string, *jwt.Token) bool
FilterGetRequest is a function that filters GET requests.
var FilterPostRequest func(*jwt.Token, *interface{}) bool
FilterPostRequest is a function that filters POST requests.
var FilterSensuData func(*jwt.Token, *structs.Data) *structs.Data
FilterSensuDataData is a function that filters Sensu Data.
var FilterStashes func(stashes *[]interface{}, token *jwt.Token) []interface{}
FilterAggregates is a function that filters aggregates
var FilterSubscriptions func(subscriptions *[]string, token *jwt.Token) []string
FilterAggregates is a function that filters aggregates
Functions ¶
func GetRoleFromToken ¶
GetRoleFromToken ...
func MergeStringSlices ¶
MergeStringSlices merges two slices of strings and remove duplicated values
func SliceIntersection ¶
SliceIntersection searches for values in both slices Returns true if there's at least one intersection
Types ¶
type Uchiwa ¶
type Uchiwa struct { Config *config.Config Daemon *daemon.Daemon Data *structs.Data Datacenters *[]sensu.Sensu Mu *sync.Mutex PublicConfig *config.Config }
Uchiwa structure is used to manage Uchiwa
func Init ¶
Init method initializes the Sensu structure with the provided configuration and start the Uchiwa daemon
func (*Uchiwa) DeleteCheckResult ¶
DeleteCheckResult sends a DELETE request in order to remove the result for a given check on a given client
func (*Uchiwa) DeleteClient ¶
DeleteClient send a DELETE request to the /clients/*client* endpoint in order to delete a client
func (*Uchiwa) DeleteStash ¶
DeleteStash send a DELETE request to the /stashes/*path* endpoint in order to delete a stash
func (*Uchiwa) GetAggregate ¶
GetAggregate retrieves a list of issued timestamps from a specified DC
func (*Uchiwa) GetAggregateByIssued ¶
func (u *Uchiwa) GetAggregateByIssued(check string, issued string, dc string) (*map[string]interface{}, error)
GetAggregateByIssued retrieves aggregate check info from a specified DC
func (*Uchiwa) IssueCheckExecution ¶
func (u *Uchiwa) IssueCheckExecution(data structs.CheckExecution) error
IssueCheckExecution sends a POST request to the /stashes endpoint in order to create a stash
func (*Uchiwa) PostStash ¶
PostStash send a POST request to the /stashes endpoint in order to create a stash
func (*Uchiwa) ResolveEvent ¶
ResolveEvent sends a DELETE request in order to resolve an event for a given check on a given client