server

package
v0.0.0-...-f011ba4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Center

func Config

func Config() config.Config

func GetLogger

func GetLogger() logger.Logger

Types

type Option

type Option func(*Proxy)

func WithLogger

func WithLogger(logger logger.Logger) Option

func WithServiceCenter

func WithServiceCenter(sc *servicediscovery.ServiceCenter) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

type Proxy

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

func New

func New() *Proxy

func NewServer

func NewServer(config config.Config, logger logger.Logger, proxyHandler func(http.ResponseWriter, *http.Request)) *Proxy

func (*Proxy) AddHandler

func (p *Proxy) AddHandler(uri string, handler func(http.ResponseWriter, *http.Request)) *Proxy

func (*Proxy) RegisterOnShutdown

func (p *Proxy) RegisterOnShutdown(f func())

func (*Proxy) Start

func (p *Proxy) Start(opts ...Option)

Jump to

Keyboard shortcuts

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