Documentation ¶
Index ¶
- type CmdOpts
- type EnsureAuth
- type WebUIServer
- func (server *WebUIServer) DeleteMetric(name string) error
- func (server *WebUIServer) DeletePreset(name string) error
- func (server *WebUIServer) DeleteSource(database string) error
- func (server *WebUIServer) GetMetrics() (res string, err error)
- func (server *WebUIServer) GetPresets() (res string, err error)
- func (server *WebUIServer) GetSources() (res string, err error)
- func (Server *WebUIServer) IsCorrectPassword(lr loginReq) bool
- func (server *WebUIServer) TryConnectToDB(params []byte) (err error)
- func (server *WebUIServer) UpdateMetric(name string, params []byte) error
- func (server *WebUIServer) UpdatePreset(name string, params []byte) error
- func (server *WebUIServer) UpdateSource(params []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdOpts ¶
type CmdOpts struct { WebDisable bool `long:"web-disable" mapstructure:"web-disable" description:"Disable the web UI" env:"PW_WEBDISABLE"` WebAddr string `` /* 135-byte string literal not displayed */ WebUser string `long:"web-user" mapstructure:"web-user" description:"Admin login" env:"PW_WEBUSER"` WebPassword string `long:"web-password" mapstructure:"web-password" description:"Admin password" env:"PW_WEBPASSWORD"` }
CmdOpts specifies the internal web UI server command-line options
type EnsureAuth ¶
type EnsureAuth struct {
// contains filtered or unexported fields
}
func NewEnsureAuth ¶
func NewEnsureAuth(handlerToWrap http.HandlerFunc) *EnsureAuth
func (*EnsureAuth) ServeHTTP ¶
func (ea *EnsureAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WebUIServer ¶
func Init ¶
func Init(opts CmdOpts, webuifs fs.FS, mrw metrics.ReaderWriter, srw sources.ReaderWriter, logger log.LoggerIface) *WebUIServer
func (*WebUIServer) DeleteMetric ¶
func (server *WebUIServer) DeleteMetric(name string) error
DeleteMetric removes the metric from the configuration
func (*WebUIServer) DeletePreset ¶
func (server *WebUIServer) DeletePreset(name string) error
DeletePreset removes the preset from the configuration
func (*WebUIServer) DeleteSource ¶
func (server *WebUIServer) DeleteSource(database string) error
DeleteSource removes the source from the list of configured sources
func (*WebUIServer) GetMetrics ¶
func (server *WebUIServer) GetMetrics() (res string, err error)
GetMetrics returns the list of metrics
func (*WebUIServer) GetPresets ¶
func (server *WebUIServer) GetPresets() (res string, err error)
GetPresets ret urns the list of available presets
func (*WebUIServer) GetSources ¶
func (server *WebUIServer) GetSources() (res string, err error)
GetSources returns the list of sources fo find databases for monitoring
func (*WebUIServer) IsCorrectPassword ¶
func (Server *WebUIServer) IsCorrectPassword(lr loginReq) bool
func (*WebUIServer) TryConnectToDB ¶
func (server *WebUIServer) TryConnectToDB(params []byte) (err error)
func (*WebUIServer) UpdateMetric ¶
func (server *WebUIServer) UpdateMetric(name string, params []byte) error
UpdateMetric updates the stored metric information
func (*WebUIServer) UpdatePreset ¶
func (server *WebUIServer) UpdatePreset(name string, params []byte) error
UpdatePreset updates the stored preset
func (*WebUIServer) UpdateSource ¶
func (server *WebUIServer) UpdateSource(params []byte) error
UpdateSource updates the configured source information
Click to show internal directories.
Click to hide internal directories.