app

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Flags = []cli.Flag{
	&cli.StringFlag{
		Name:  "http-addr",
		Usage: "http server address",
		Value: ":8080",
	},
	&cli.StringFlag{
		Name:  "log-level",
		Usage: "log level (debug, info, warn, error)",
		Value: "info",
	},
	&cli.StringFlag{
		Name:  "namespace",
		Usage: "prefix for Prometheus metrics",
		Value: "near_validator_watcher",
	},
	&cli.BoolFlag{
		Name:  "no-color",
		Usage: "disable colored output",
	},
	&cli.StringFlag{
		Name:  "node",
		Usage: "rpc node endpoint to connect to",
		Value: "https://rpc.mainnet.near.org",
	},
	&cli.DurationFlag{
		Name:  "refresh-rate",
		Usage: "how often to call the rpc endpoint",
		Value: 10 * time.Second,
	},
	&cli.StringSliceFlag{
		Name:  "validator",
		Usage: "validator pool id to track",
	},
}

Functions

func RunFunc

func RunFunc(cCtx *cli.Context) error

Types

type HTTPMuxOption

type HTTPMuxOption func(*http.ServeMux)

func WithLiveProbe

func WithLiveProbe(probe Probe) HTTPMuxOption

func WithMetrics

func WithMetrics(registry *prometheus.Registry) HTTPMuxOption

func WithReadyProbe

func WithReadyProbe(probe Probe) HTTPMuxOption

type HTTPServer

type HTTPServer struct {
	*http.Server
}

func NewHTTPServer

func NewHTTPServer(addr string, options ...HTTPMuxOption) *HTTPServer

func (*HTTPServer) Run

func (s *HTTPServer) Run() error

func (*HTTPServer) Shutdown

func (s *HTTPServer) Shutdown(ctx context.Context) error

type Probe

type Probe func() bool

Jump to

Keyboard shortcuts

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