Documentation ¶
Index ¶
- Variables
- type Config
- type Datasource
- type DatasourceResp
- type Prometheus
- func (db *Prometheus) APIs() []rpc.API
- func (db *Prometheus) CorsProtocols() []p2p.Protocol
- func (db *Prometheus) GenesisHash() common.Hash
- func (db *Prometheus) HandlerForQuery(reg prometheus.Gatherer, opts promhttp.HandlerOpts) http.Handler
- func (db *Prometheus) Protocols() []p2p.Protocol
- func (db *Prometheus) QueryHandler() http.Handler
- func (db *Prometheus) Start(server *p2p.Server, corss *p2p.Server) error
- func (db *Prometheus) Stop() error
- type QueryResp
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Host: "localhost", Port: 8080, Refresh: 5 * time.Second, }
DefaultConfig contains default settings for the dashboard.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Host is the host interface on which to start the dashboard server. If this // field is empty, no dashboard will be started. Host string `toml:",omitempty"` // Port is the TCP port number on which to start the dashboard server. The // default zero value is/ valid and will pick a port number randomly (useful // for ephemeral nodes). Port int `toml:",omitempty"` // Refresh is the refresh rate of the data updates, the chartEntry will be collected this often. Refresh time.Duration `toml:",omitempty"` }
Config contains the configuration parameters of the dashboard.
type Datasource ¶
type Datasource struct { ID int `json:"id"` OrgID int `json:"orgId"` Name string `json:"name"` Type string `json:"type"` TypeLogoURL string `json:"typeLogoUrl"` Access string `json:"access"` URL string `json:"url"` Password string `json:"password"` User string `json:"user"` Database string `json:"database"` BasicAuth bool `json:"basicAuth"` BasicAuthUser string `json:"basicAuthUser"` BasicAuthPassword string `json:"basicAuthPassword"` WithCredentials bool `json:"withCredentials"` IsDefault bool `json:"isDefault"` JSONData struct { HTTPMethod string `json:"httpMethod"` KeepCookies []interface{} `json:"keepCookies"` } `json:"jsonData"` SecureJSONFields struct { } `json:"secureJsonFields"` Version int `json:"version"` ReadOnly bool `json:"readOnly"` }
type DatasourceResp ¶
type DatasourceResp struct { Datasource Datasource `json:"datasource"` ID int `json:"id"` Message string `json:"message"` Name string `json:"name"` }
type Prometheus ¶
type Prometheus struct {
// contains filtered or unexported fields
}
Prometheus contains the dashboard internals.
func New ¶
func New(config Config) (*Prometheus, error)
New creates a new dashboard instance with the given configuration.
func (*Prometheus) APIs ¶
func (db *Prometheus) APIs() []rpc.API
APIs is a meaningless implementation of node.Service.
func (*Prometheus) CorsProtocols ¶
func (db *Prometheus) CorsProtocols() []p2p.Protocol
func (*Prometheus) GenesisHash ¶
func (db *Prometheus) GenesisHash() common.Hash
func (*Prometheus) HandlerForQuery ¶
func (db *Prometheus) HandlerForQuery(reg prometheus.Gatherer, opts promhttp.HandlerOpts) http.Handler
func (*Prometheus) Protocols ¶
func (db *Prometheus) Protocols() []p2p.Protocol
Protocols is a meaningless implementation of node.Service.
func (*Prometheus) QueryHandler ¶
func (db *Prometheus) QueryHandler() http.Handler
func (*Prometheus) Start ¶
Start implements node.Service, starting the data collection thread and the listening server of the dashboard.
func (*Prometheus) Stop ¶
func (db *Prometheus) Stop() error
Stop implements node.Service, stopping the data collection thread and the connection listener of the dashboard.
Click to show internal directories.
Click to hide internal directories.