op_heartbeat

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsNamespace     = "op_heartbeat"
	MinHeartbeatInterval = 10*time.Minute - 10*time.Second
	UsersCacheSize       = 10_000
)
View Source
const (
	HTTPMaxHeaderSize = 10 * 1024
	HTTPMaxBodySize   = 1024 * 1024
)

Variables

View Source
var AllowedChainIDs = map[uint64]bool{
	420: true,
	902: true,
	10:  true,
}
View Source
var AllowedVersions = map[string]bool{
	"":                          true,
	"v0.1.0-beta.1":             true,
	"v0.1.0-goerli-rehearsal.1": true,
	"v0.10.9":                   true,
	"v0.10.10":                  true,
	"v0.10.11":                  true,
	"v0.10.12":                  true,
	"v0.10.13":                  true,
	"v0.10.14":                  true,
	"v0.11.0":                   true,
}

Functions

func Handler

func Handler(l log.Logger, metrics Metrics) http.HandlerFunc

func HealthzHandler

func HealthzHandler(w http.ResponseWriter, r *http.Request)

func Main

func Main(version string) func(ctx *cli.Context) error

Types

type Config

type Config struct {
	HTTPAddr string
	HTTPPort int

	Log oplog.CLIConfig

	Metrics opmetrics.CLIConfig

	Pprof oppprof.CLIConfig
}

func NewConfig

func NewConfig(ctx *cli.Context) Config

func (Config) Check

func (c Config) Check() error

type HeartbeatService added in v1.4.2

type HeartbeatService struct {
	// contains filtered or unexported fields
}

func Start

func Start(ctx context.Context, l log.Logger, cfg Config, version string) (*HeartbeatService, error)

func (*HeartbeatService) Stop added in v1.4.2

func (hs *HeartbeatService) Stop(ctx context.Context) error

type Metrics

type Metrics interface {
	RecordHeartbeat(payload heartbeat.Payload, ip string)
	RecordVersion(version string)
}

func NewMetrics

func NewMetrics(r *prometheus.Registry) Metrics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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