proxy

package
v0.0.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCProxy

type GRPCProxy struct {
	Proxy
}

func NewGRPCProxy

func NewGRPCProxy(
	ch chan seed.Seed,
	cfg config.Config,
	log *slog.Logger,
) *GRPCProxy

func (*GRPCProxy) ServeHTTP

func (p *GRPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*GRPCProxy) Start

func (p *GRPCProxy) Start(ctx context.Context)

type Proxy

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

func (*Proxy) Live

func (p *Proxy) Live() bool

func (*Proxy) Ready

func (p *Proxy) Ready() bool

func (*Proxy) Start

func (p *Proxy) Start(ctx context.Context, update Updater)

func (*Proxy) Stats

func (p *Proxy) Stats() []ServerStat

type RPCProxy

type RPCProxy struct {
	Proxy
}

func NewRPCProxy

func NewRPCProxy(
	ch chan seed.Seed,
	cfg config.Config,
	log *slog.Logger,
) *RPCProxy

func (*RPCProxy) ServeHTTP

func (p *RPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*RPCProxy) Start

func (p *RPCProxy) Start(ctx context.Context)

type RestProxy

type RestProxy struct {
	Proxy
}

func NewRestProxy

func NewRestProxy(
	ch chan seed.Seed,
	cfg config.Config,
	log *slog.Logger,
) *RestProxy

func (*RestProxy) ServeHTTP

func (p *RestProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*RestProxy) Start

func (p *RestProxy) Start(ctx context.Context)

type Server

type Server struct {
	Url *url.URL
	// contains filtered or unexported fields
}

func (*Server) ErrorRate

func (s *Server) ErrorRate() float64

func (*Server) Healthy

func (s *Server) Healthy() bool

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerStat

type ServerStat struct {
	Name        string
	URL         string
	Avg         time.Duration
	Degraded    bool
	Initialized bool
	Requests    int64
	ErrorRate   float64
}

type Updater

type Updater func(s seed.Seed)

Jump to

Keyboard shortcuts

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