forky

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 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"`

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

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 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) 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