controlserver

package
v0.0.0-...-7fa21a5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceExpiration = 30 * time.Second // passed in to the Start() function, to make tests easier
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(req api.Request) (api.Message, error)

type Server

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

func Start

func Start(config *config.Config, me *config.Peer, listenSpec string, expireTime, bootWait time.Duration) (*Server, error)

Start the control server in the background.

We assume after bootWait, with no errors, the server has started. I can't see a better way to do this with net/http since there is not a notifier callback. Would prefer a better way to launch the server without blocking.

func (*Server) ReplaceConfig

func (s *Server) ReplaceConfig(newConfig *config.Config, newChain *hashchain.Chain) error

func (*Server) Shutdown

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

Shutdown the server. Accept a context for timing out the shutdown process.

Jump to

Keyboard shortcuts

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