Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type MultiClient
- func (c *MultiClient) ClientCount() int
- func (c *MultiClient) Close() (result error)
- func (c *MultiClient) CreateClients() error
- func (c *MultiClient) IsAdmin(username string) bool
- func (c *MultiClient) Request(context context.Context, request, authUser string, limit int) ([]gin.H, error)
- func (c *MultiClient) RequestRaw(context context.Context, request, outputFormat, authUser string, limit int) ([]byte, error)
- func (c *MultiClient) SetLogger(logger *log.Logger)
- type Server
- type SingleClient
- func (c *SingleClient) ClientCount() int
- func (c *SingleClient) Close() error
- func (c *SingleClient) IsAdmin(username string) bool
- func (c *SingleClient) Request(context context.Context, request, authUser string, limit int) ([]gin.H, error)
- func (c *SingleClient) RequestRaw(context context.Context, request, outputFormat, authUser string, limit int) ([]byte, error)
- func (c *SingleClient) SetLogger(logger *log.Logger)
- type UserData
- type UsersWatcher
- type V1RawRequestParams
- type V1StatsTacticalOverview
- type V1StatsTacticalOverviewEntry
Constants ¶
View Source
const CtxKeyLQLClient = "lqlClient"
CtxKeyLQLClient is they key for the Client in the gin context.
Variables ¶
View Source
var ( // Logger is the Global logrus logger Logger *log.Logger )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
ClientCount() int
IsAdmin(username string) bool
SetLogger(logger *log.Logger)
Close() error
Request(context context.Context, request, authUser string, limit int) ([]gin.H, error)
RequestRaw(context context.Context, request, outputFormat, authUser string, limit int) ([]byte, error)
}
func GinGetLqlClient ¶
GinGetLqlClient gets the LQL Client from a gin context
func NewMultiClient ¶
type MultiClient ¶
type MultiClient struct {
// contains filtered or unexported fields
}
func (*MultiClient) ClientCount ¶
func (c *MultiClient) ClientCount() int
func (*MultiClient) Close ¶
func (c *MultiClient) Close() (result error)
func (*MultiClient) CreateClients ¶
func (c *MultiClient) CreateClients() error
func (*MultiClient) IsAdmin ¶
func (c *MultiClient) IsAdmin(username string) bool
func (*MultiClient) RequestRaw ¶
func (*MultiClient) SetLogger ¶
func (c *MultiClient) SetLogger(logger *log.Logger)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
type SingleClient ¶
type SingleClient struct {
// contains filtered or unexported fields
}
func (*SingleClient) ClientCount ¶
func (c *SingleClient) ClientCount() int
func (*SingleClient) Close ¶
func (c *SingleClient) Close() error
func (*SingleClient) IsAdmin ¶
func (c *SingleClient) IsAdmin(username string) bool
func (*SingleClient) RequestRaw ¶
func (*SingleClient) SetLogger ¶
func (c *SingleClient) SetLogger(logger *log.Logger)
type UsersWatcher ¶
type UsersWatcher struct {
// contains filtered or unexported fields
}
func NewUsersWatcher ¶
func NewUsersWatcher(usersfile string) (*UsersWatcher, error)
func (*UsersWatcher) Close ¶
func (uw *UsersWatcher) Close()
func (*UsersWatcher) FetchUsers ¶
func (uw *UsersWatcher) FetchUsers() error
func (*UsersWatcher) IsAdmin ¶
func (uw *UsersWatcher) IsAdmin(userName string) bool
func (*UsersWatcher) SetLogger ¶
func (uw *UsersWatcher) SetLogger(logger *log.Logger)
func (*UsersWatcher) StartWatching ¶
func (uw *UsersWatcher) StartWatching()
type V1RawRequestParams ¶
type V1RawRequestParams struct {
Method string `json:"method" validate:"required" description:"Either GET or COMMAND"`
// COMMAND
Command string `json:"command" description:"The command, required if method is COMMAND"`
// GET
Table string `json:"table" description:"The table to query, required if method is GET"`
Columns []string `json:"columns" description:"Columns to query, you should always provide this"`
Query [][]string `json:"query" description:"raw query Data"`
// both
Limit int `json:"limit" description:"Limit result count"`
}
V1RawRequestParams is a request for the RAW API
type V1StatsTacticalOverview ¶
type V1StatsTacticalOverview struct {
Hosts *V1StatsTacticalOverviewEntry `json:"hosts" validate:"required" description:"Host stats"`
Services *V1StatsTacticalOverviewEntry `json:"services" validate:"required" description:"Service stats"`
Events *V1StatsTacticalOverviewEntry `json:"events" validate:"required" description:"Event stats"`
}
type V1StatsTacticalOverviewEntry ¶
type V1StatsTacticalOverviewEntry struct {
All float64 `json:"all" validate:"required" description:"all services/hosts"`
Problems float64 `json:"problems" validate:"require" description:"Num of problems"`
Unhandled float64 `json:"unhandled" validate:"require" description:"Num of unhandled"`
Stale float64 `json:"stale" validate:"require" description:"Num of stale"`
}
Click to show internal directories.
Click to hide internal directories.