Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrIPNotSet = errors.New("ip not set")
)
View Source
var ( // ErrUnsupportedProtocol indicates the protocol is not supported. ErrUnsupportedProtocol = errors.New("unsupported protocol") )
Functions ¶
func RegisterBuilder ¶
RegisterBuilder registers the given proc builder to the builder map.
Types ¶
type BuildParams ¶
type Builder ¶
type Builder interface {
// Build builds a new processor.
Build(params BuildParams) (Proc, error)
}
Builder creates a processor.
type CommonStats ¶
type CommonStats struct {
CxTotal *stats.Counter // total connections
CxDestroyTotal *stats.Counter // destroyed connections
CxActive *stats.Gauge // active connections
CxLengthSec *stats.Histogram // connection length
CxRxBytesTotal *stats.Counter // received connection bytes
CxTxBytesTotal *stats.Counter // sent connection bytes
RqTotal *stats.Counter // total request
RqSuccessTotal *stats.Counter // success request
RqFailureTotal *stats.Counter // failed request
RqActive *stats.Gauge // active request
RqDurationMs *stats.Histogram // request duration
RqRxBytesLength *stats.Histogram // received request bytes length
RqTxBytesLength *stats.Histogram // sent request bytes length
}
type ConnHandlerFunc ¶
type DownstreamStats ¶
type DownstreamStats struct {
*stats.Scope
CommonStats
CxRestricted *stats.Counter // restricted connections
}
func NewDownstreamStats ¶
func NewDownstreamStats(scope *stats.Scope) *DownstreamStats
type Listener ¶
func NewListener ¶
func NewListener(cfg *service.Listener, stats *DownstreamStats, logger log.Logger, connHandleFn ConnHandlerFunc) (Listener, error)
type Proc ¶
type Proc interface {
Name() string
Address() string
Config() *service.Config
OnSvcHostAdd([]*host.Host) error
OnSvcHostRemove([]*host.Host) error
OnSvcAllHostReplace([]*host.Host) error
OnSvcConfigUpdate(*service.Config) error
Start() error
StopListen() error
Stop() error
}
Proc is used to handle and forward the network traffic.
type Stats ¶
type Stats struct {
*stats.Scope
Downstream *DownstreamStats
Upstream *UpstreamStats
}
type UpstreamStats ¶
type UpstreamStats struct {
*stats.Scope
CommonStats
CxConnectTimeout *stats.Counter // total connection connect timeouts
CxConnectFail *stats.Counter // total connection failures
}
func NewUpstreamStats ¶
func NewUpstreamStats(scope *stats.Scope) *UpstreamStats
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
syscall
Package syscall provides functionalities that grpc uses to get low-level operating system stats/info.
|
Package syscall provides functionalities that grpc uses to get low-level operating system stats/info. |
|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
|
compressor
Package compressor is a generated GoMock package.
|
Package compressor is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.