server

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProbeExists when we register the same probe.
	ErrProbeExists = errors.New("probe exists")

	// ErrNoRegistrations have been added.
	ErrNoRegistrations = errors.New("no registrations")

	// ErrRegistrationNotFound in register.
	ErrRegistrationNotFound = errors.New("registration not found")
)

Functions

This section is empty.

Types

type Registration

type Registration struct {
	Name    string
	Period  time.Duration
	Checker checker.Checker
}

Registration for the server.

func NewRegistration

func NewRegistration(name string, period time.Duration, ch checker.Checker) *Registration

NewRegistration for server.

type Server

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

Server will maintain all the probes and start and stop them.

func NewServer

func NewServer() *Server

NewServer for health.

func (*Server) Observe

func (s *Server) Observe(names ...string) (*subscriber.Observer, error)

Observe the names of the probes.

func (*Server) Register

func (s *Server) Register(regs ...*Registration) error

Register all the registrations.

func (*Server) Start

func (s *Server) Start() error

Start the server.

func (*Server) Stop

func (s *Server) Stop() error

Stop the server.

func (*Server) Subscribe

func (s *Server) Subscribe(names ...string) (*subscriber.Subscriber, error)

Subscribe to the names of the probes.

Jump to

Keyboard shortcuts

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