backend

package
v0.0.0-...-55f2b63 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseBackend

type BaseBackend struct {
	URL   *url.URL
	Alive bool

	ReverseProxy *httputil.ReverseProxy
	// contains filtered or unexported fields
}

func (*BaseBackend) IsAlive

func (backend *BaseBackend) IsAlive() bool

func (*BaseBackend) ServeHTTP

func (backend *BaseBackend) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*BaseBackend) SetAlive

func (backend *BaseBackend) SetAlive(alive bool)

type IBackend

type IBackend interface {
	IsAlive() bool
	SetAlive(alive bool)
	ServeHTTP(writer http.ResponseWriter, request *http.Request)
}

type SimpleBackend

type SimpleBackend struct {
	BaseBackend
}

func NewSimpleBackend

func NewSimpleBackend(url *url.URL, alive bool, proxy *httputil.ReverseProxy) *SimpleBackend

func (*SimpleBackend) IsAlive

func (b *SimpleBackend) IsAlive() (alive bool)

IsAlive returns true when backend is alive

func (*SimpleBackend) ServeHTTP

func (b *SimpleBackend) ServeHTTP(writer http.ResponseWriter, request *http.Request)

func (*SimpleBackend) SetAlive

func (b *SimpleBackend) SetAlive(alive bool)

SetAlive for this backend

Jump to

Keyboard shortcuts

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