Documentation ¶
Index ¶
- Constants
- Variables
- type BreadcrumbProvider
- type Config
- type Server
- func (s *Server) NumActiveConnections() int
- func (s *Server) Port() int
- func (s *Server) SetMaxConns(numConns int)
- func (s *Server) ShutDownGracefully()
- func (s *Server) ShuttingDown() bool
- func (s *Server) Start(cxt context.Context)
- func (s *Server) TerminateRandomConnection(logCtx *log.Entry, reason string) bool
- type SnappySnapshotCache
- type WriteDeadlineSetter
Constants ¶
View Source
const (
PortRandom = -1
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BreadcrumbProvider ¶
type BreadcrumbProvider interface {
CurrentBreadcrumb() *snapcache.Breadcrumb
}
type Config ¶
type Config struct { Port int MaxMessageSize int BinarySnapshotTimeout time.Duration MaxFallBehind time.Duration NewClientFallBehindGracePeriod time.Duration MinBatchingAgeThreshold time.Duration PingInterval time.Duration PongTimeout time.Duration WriteTimeout time.Duration DropInterval time.Duration ShutdownTimeout time.Duration ShutdownMaxDropInterval time.Duration MaxConns int HealthAggregator *health.HealthAggregator KeyFile string CertFile string CAFile string ClientCN string ClientURISAN string WriteBufferSize int // DebugLogWrites tells the server to wrap each connection with a Writer that // logs every write. Intended only for use in tests! DebugLogWrites bool // FIPSModeEnabled Enables FIPS 140-2 verified crypto mode. FIPSModeEnabled bool }
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults()
func (*Config) ListenPort ¶
type Server ¶
func New ¶
func New(caches map[syncproto.SyncerType]BreadcrumbProvider, config Config) *Server
func (*Server) NumActiveConnections ¶
func (*Server) SetMaxConns ¶
func (*Server) ShutDownGracefully ¶
func (s *Server) ShutDownGracefully()
func (*Server) ShuttingDown ¶
type SnappySnapshotCache ¶
type SnappySnapshotCache struct {
// contains filtered or unexported fields
}
func NewSnappySnapCache ¶
func NewSnappySnapCache( syncerName string, cache BreadcrumbProvider, snapValidityTimeout time.Duration, writeTimeout time.Duration, ) *SnappySnapshotCache
func (*SnappySnapshotCache) SendSnapshot ¶
func (s *SnappySnapshotCache) SendSnapshot(ctx context.Context, w io.Writer, conn WriteDeadlineSetter) (*snapcache.Breadcrumb, error)
SendSnapshot waits for a binary snapshot to be ready and then sends it as a raw snappy-compressed gob stream on the given connection. Since the stream is cached, it starts with fresh snappy/gob headers. Hence, the decoder at the client side must also be reset before sending such a snapshot. The snapshot ends with a MsgDecoderRestart, so the caller should wait for an ACK and then reset their encoder.
type WriteDeadlineSetter ¶
Click to show internal directories.
Click to hide internal directories.