server

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnectorIdHttp  = ConnectorId("http")
	DefaultConnectorIdHttps = ConnectorId("https")

	ConnectorKey = "lingress.server.connector"
)

Variables

View Source
var (
	ErrIllegalConnectorId = errors.New("illegal connector-id")
)

Functions

func ContextWithConnector

func ContextWithConnector(ctx context.Context, connector Connector) context.Context

Types

type AnnotatedAddr added in v0.2.4

type AnnotatedAddr interface {
	net.Addr
	GetState() *http.ConnState
	SetState(*http.ConnState)
}

type Connector

type Connector interface {
	GetId() ConnectorId
}

func GetConnectorOfContext

func GetConnectorOfContext(ctx context.Context) Connector

type ConnectorHandler

type ConnectorHandler interface {
	ServeHTTP(Connector, http.ResponseWriter, *http.Request)
	OnConnState(Connector, net.Conn, http.ConnState)
}

type ConnectorId

type ConnectorId string

func (ConnectorId) MarshalText

func (this ConnectorId) MarshalText() (text []byte, err error)

func (*ConnectorId) Set

func (this *ConnectorId) Set(plain string) error

func (ConnectorId) String

func (this ConnectorId) String() string

func (*ConnectorId) UnmarshalText

func (this *ConnectorId) UnmarshalText(text []byte) error

type HttpConnector

type HttpConnector struct {
	Id      ConnectorId
	Handler ConnectorHandler
	Logger  log.Logger

	Server       http.Server
	ListenConfig net.ListenConfig
	// contains filtered or unexported fields
}

func NewHttpConnector

func NewHttpConnector(s *settings.Settings, id ConnectorId, logger log.Logger) (*HttpConnector, error)

func (*HttpConnector) GetId

func (this *HttpConnector) GetId() ConnectorId

func (*HttpConnector) Serve

func (this *HttpConnector) Serve(stop support.Channel) error

func (*HttpConnector) Shutdown

func (this *HttpConnector) Shutdown()

Jump to

Keyboard shortcuts

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