xmonitor

package
v2.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ModName = "server.monitor"

ModName ..

Variables

View Source
var (
	// DefaultServeMux ...
	DefaultServeMux = http.NewServeMux()
)

DefaultServeMux ...

Functions

This section is empty.

Types

type Config

type Config struct {
	Host           string
	Port           int
	Deployment     string
	Mode           string
	ServiceAddress string // ServiceAddress service address in registry info, default to 'Host:Port'
}

Config HTTP config

func New

func New() *Config

New ...

func (Config) Address

func (config Config) Address() string

Address ...

func (*Config) Build

func (config *Config) Build() *Server

Build ...

func (*Config) WithDeployment

func (config *Config) WithDeployment(deployment string) *Config

WithDeployment ...

func (*Config) WithHost

func (config *Config) WithHost(host string) *Config

WithHost ...

func (*Config) WithMode

func (config *Config) WithMode(mode string) *Config

WithMode ...

func (*Config) WithPort

func (config *Config) WithPort(port int) *Config

WithPort ...

func (*Config) WithServiceAddress

func (config *Config) WithServiceAddress(serviceAddress string) *Config

WithServiceAddress ...

type Server

type Server struct {
	*http.Server

	*Config
	// contains filtered or unexported fields
}

Server ...

func (*Server) GracefulStop

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

GracefulStop ..

func (*Server) HandleFunc

func (s *Server) HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc ...

func (*Server) Healthz

func (s *Server) Healthz() bool

Healthz TODO(roamerlv):

func (*Server) Info

func (s *Server) Info() *server.ServiceInfo

Info ..

func (*Server) InitHandle

func (s *Server) InitHandle()

InitHandle ...

func (*Server) Serve

func (s *Server) Serve() error

Serve ..

func (*Server) Stop

func (s *Server) Stop() error

Stop ..

Jump to

Keyboard shortcuts

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