server

package
v0.0.0-...-ec09dfe Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalancedOutboundPipe

type BalancedOutboundPipe struct {
	OutboundPipe
	Balancer loadbalance.Balancer
}

func NewBalancedOutboundPipe

func NewBalancedOutboundPipe(pipe *OutboundPipe, balancer loadbalance.Balancer) *BalancedOutboundPipe

func (BalancedOutboundPipe) Pull

func (pipe BalancedOutboundPipe) Pull() ([]byte, error)

type FacadeServer

type FacadeServer struct {
	Server
	Name    string
	Address string
	Port    int
	Cache   cache.Cacher
	Matcher Matcher
	Errors  chan error
	Logger  *logging.Logger
}

FacadeServer contains all data and embeddings a Server would need.

func NewFacadeServer

func NewFacadeServer(name string, address string, port int, matcher Matcher) FacadeServer

func (*FacadeServer) GetFromCache

func (server *FacadeServer) GetFromCache(request []byte) []byte

type Matcher

type Matcher interface {
	Match(request []byte) Pipe
}

type OutboundPipe

type OutboundPipe struct {
	Pipe
	Address []byte
	Client  *fasthttp.Client
}

func NewOutboundPipe

func NewOutboundPipe(address []byte) *OutboundPipe

func (OutboundPipe) Pull

func (pipe OutboundPipe) Pull() ([]byte, error)

type Pipe

type Pipe interface {
	Pull() ([]byte, error)
}

type RedirectHostMatcher

type RedirectHostMatcher struct {
	Matcher
	Host string
}

func (RedirectHostMatcher) Match

func (matcher RedirectHostMatcher) Match(request []byte) Pipe

type Server

type Server interface {
	Start()
	Stop() error
	GetFromCache(request []byte) []byte
}

Server serves requests for content.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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