proxy

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultPreparedCache

func NewDefaultPreparedCache(size int) (proxycore.PreparedCache, error)

NewDefaultPreparedCache creates a new default prepared cache capping the max item capacity to `size`.

Types

type Config

type Config struct {
	Version           primitive.ProtocolVersion
	MaxVersion        primitive.ProtocolVersion
	Auth              proxycore.Authenticator
	Resolver          proxycore.EndpointResolver
	ReconnectPolicy   proxycore.ReconnectPolicy
	NumConns          int
	Logger            *zap.Logger
	HeartBeatInterval time.Duration
	IdleTimeout       time.Duration
	// PreparedCache a cache that stores prepared queries. If not set it uses the default implementation with a max
	// capacity of ~100MB.
	PreparedCache proxycore.PreparedCache
}

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(ctx context.Context, config Config) *Proxy

func (*Proxy) Listen

func (p *Proxy) Listen(address string) error

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe(address string) error

func (*Proxy) OnEvent

func (p *Proxy) OnEvent(event interface{})

func (*Proxy) Serve

func (p *Proxy) Serve() error

func (*Proxy) Shutdown

func (p *Proxy) Shutdown() error

Jump to

Keyboard shortcuts

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