shared

package
v0.0.0-...-b605237 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// Start spawns any goroutines required by the service.
	Start()
	// Stop terminates all goroutines belonging to the service,
	// blocking until they are all terminated.
	Stop() error
}

Service is a struct that can be registered into a ServiceRegistry for easy dependency management.

type ServiceRegistry

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

ServiceRegistry provides a useful pattern for managing services. It allows for ease of dependency management and ensures services dependent on others use the same references in memory.

func NewServiceRegistry

func NewServiceRegistry() *ServiceRegistry

NewServiceRegistry starts a registry instance for convenience

func (*ServiceRegistry) FetchService

func (s *ServiceRegistry) FetchService(service interface{}) error

FetchService takes in a struct pointer and sets the value of that pointer to a service currently stored in the service registry. This ensures the input argument is set to the right pointer that refers to the originally registered service.

func (*ServiceRegistry) RegisterService

func (s *ServiceRegistry) RegisterService(service Service) error

RegisterService appends a service constructor function to the service registry.

func (*ServiceRegistry) StartAll

func (s *ServiceRegistry) StartAll()

StartAll initialized each service in order of registration.

func (*ServiceRegistry) StopAll

func (s *ServiceRegistry) StopAll()

StopAll ends every service in reverse order of registration, logging a panic if any of them fail to stop.

Directories

Path Synopsis
Package bls implements a go-wrapper around a C BLS library leveraging the BLS12-381 curve.
Package bls implements a go-wrapper around a C BLS library leveraging the BLS12-381 curve.
Package bytes defines helper methods for converting integers to byte slices.
Package bytes defines helper methods for converting integers to byte slices.
Package cmd defines the command line flags for the shared utlities.
Package cmd defines the command line flags for the shared utlities.
Package database defines a beacon chain DB service that can be initialized with either a persistent db, or an in-memory kv-store.
Package database defines a beacon chain DB service that can be initialized with either a persistent db, or an in-memory kv-store.
Package debug defines useful profiling utils that came originally with go-ethereum.
Package debug defines useful profiling utils that came originally with go-ethereum.
Package legacyutil exists to convert Ethereum Serenity types to go-ethereum or Ethereum 1.0 types.
Package legacyutil exists to convert Ethereum Serenity types to go-ethereum or Ethereum 1.0 types.
Package mclock is a wrapper for a monotonic clock source
Package mclock is a wrapper for a monotonic clock source
p2p
Package p2p handles peer-to-peer networking for Ethereum Serenity clients.
Package p2p handles peer-to-peer networking for Ethereum Serenity clients.
adapter/metric
Package metric contain some prometheus collectors for p2p services.
Package metric contain some prometheus collectors for p2p services.
mock
Package mock_p2p is a generated GoMock package.
Package mock_p2p is a generated GoMock package.
Package params defines important constants that are essential to the Ethereum 2.0 services.
Package params defines important constants that are essential to the Ethereum 2.0 services.
Package shardutil defines independent utilities helpful for a sharding-enabled, Ethereum blockchain such as blob serialization as more.
Package shardutil defines independent utilities helpful for a sharding-enabled, Ethereum blockchain such as blob serialization as more.
Package ssz implements the Simple Serialize algorithm specified at https://github.com/ethereum/eth2.0-specs/blob/master/specs/simple-serialize.md
Package ssz implements the Simple Serialize algorithm specified at https://github.com/ethereum/eth2.0-specs/blob/master/specs/simple-serialize.md
Package testutil defines the testing utils such as asserting logs.
Package testutil defines the testing utils such as asserting logs.

Jump to

Keyboard shortcuts

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