forky

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr string        `yaml:"listen_addr" default:":5555"`
	LogLevel   string        `yaml:"log_level" default:"warn"`
	Metrics    MetricsConfig `yaml:"metrics"`
	PProfAddr  *string       `yaml:"pprof_addr" default:":6060"`

	Forky *service.Config `yaml:"forky"`

	HTTP *api.Config `yaml:"http" default:"{}"`
}

func NewConfigFromYAML

func NewConfigFromYAML(y []byte) (*Config, error)

func NewConfigFromYAMLFile

func NewConfigFromYAMLFile(file string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `yaml:"enabled" default:"true"`
	Addr    string `yaml:"addr" default:":9090"`
}

type NotFoundRedirectRespWr added in v0.0.21

type NotFoundRedirectRespWr struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*NotFoundRedirectRespWr) Write added in v0.0.21

func (w *NotFoundRedirectRespWr) Write(p []byte) (int, error)

func (*NotFoundRedirectRespWr) WriteHeader added in v0.0.21

func (w *NotFoundRedirectRespWr) WriteHeader(status int)

type Server

type Server struct {
	Cfg Config
	// contains filtered or unexported fields
}

Server is the main server for the forkchoice service. It glues together the service and the http api, while also providing metrics and static file serving.

func NewServer

func NewServer(log *logrus.Logger, conf *Config) *Server

func (*Server) ServeMetrics

func (s *Server) ServeMetrics(ctx context.Context) error

func (*Server) ServePProf added in v0.0.8

func (s *Server) ServePProf(ctx context.Context) error

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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