server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthzHandler

func HealthzHandler() http.Handler

func LoggingMiddleware

func LoggingMiddleware() func(http.Handler) http.Handler

LoggingMiddleware logs the incoming HTTP request & its duration.

func RegisterFlags

func RegisterFlags(fs *pflag.FlagSet)

Types

type Option

type Option func(*Server)

func WithDrainTimeout

func WithDrainTimeout(timeout time.Duration) Option

func WithListenAddress

func WithListenAddress(addr string) Option

type RegisterHandler

type RegisterHandler interface {
	HttpHandler() (string, http.Handler)
}

type Server

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

func InitFromViper

func InitFromViper(v *viper.Viper) *Server

func New

func New(opt ...Option) *Server

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(handler RegisterHandler)

func (*Server) Run

func (s *Server) Run(stop <-chan struct{}) error

Jump to

Keyboard shortcuts

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