governor

package
v0.0.0-...-a89d410 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ModName = "govern"

ModName ..

Variables

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

Functions

func HandleFunc

func HandleFunc(pattern string, handler http.HandlerFunc)

HandleFunc ...

Types

type Config

type Config struct {
	Host    string
	Port    int
	Network string `json:"network" toml:"network"`

	Enable bool

	// ServiceAddress service address in registry info, default to 'Host:Port'
	ServiceAddress string
	// contains filtered or unexported fields
}

Config ...

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig represents default config User should construct config base on DefaultConfig

func RawConfig

func RawConfig(key string) *Config

RawConfig ...

func StdConfig

func StdConfig(name string) *Config

StdConfig represents Standard gRPC Server config which will parse config by conf package, panic if no config key found in conf

func (Config) Address

func (config Config) Address() string

Address ...

func (*Config) Build

func (config *Config) Build() *Server

Build ...

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) Healthz

func (s *Server) Healthz() bool

Healthz TODO(roamerlv):

func (*Server) Info

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

Info ..

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