seederserver

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(c *config)

Option is a functional option for configuring the seeder server.

func WithListeners

func WithListeners(listeners []net.Listener) Option

WithListeners sets the listeners for the configuration.

func WithLogger

func WithLogger(log slog.Logger) Option

WithLogger sets the logger for the configuration.

func WithPromotionTimeLimits

func WithPromotionTimeLimits(waitForMaster, offlineLimit time.Duration) Option

WithPromotionTimeLimits sets the time limits for promotion of a server to master.

waitForMaster is the minimum seeder uptime before any server that does not identify itself as master to be promoted to master.

offlineLimit is the maximum amount of time a server may have one of its subsystems offline after which it is demoted from being master.

func WithTokens

func WithTokens(tokens map[string]struct{}) Option

WithTokens sets the tokens for the configuration.

type Server

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

Server is a runnable BR seeder server.

func New

func New(opts ...Option) (*Server, error)

New creates a new seeder server.

func (*Server) Run

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

Run runs the seeder server. Listeners are closed once this server is commanded to stop (if ctx is canceled) or when any error occurs.

Jump to

Keyboard shortcuts

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