server

package
v1.9.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(setters ...Option) *srv

func NewMessageReader

func NewMessageReader(conn net.Conn) *messageReader

func NewSession

func NewSession(c net.Conn, log logger.Logger, sysDb database.DB, tlsConfig *tls.Config) *session

func NewSessionFactory

func NewSessionFactory() sessionFactory

Types

type MessageReader

type MessageReader interface {
	ReadRawMessage() (*rawMessage, error)
	Write(msg []byte) (int, error)
	Read(data []byte) (int, error)
	UpgradeConnection(conn net.Conn)
	CloseConnection() error
	Connection() net.Conn
}

type Option

type Option func(s *srv)

func Address added in v1.0.5

func Address(addr string) Option

func DatabaseList

func DatabaseList(dbList database.DatabaseList) Option

func Logger

func Logger(logger logger.Logger) Option

func Port

func Port(port int) Option

func SessFactory

func SessFactory(sf SessionFactory) Option

func SysDb

func SysDb(sysdb database.DB) Option

func TlsConfig

func TlsConfig(tlsConfig *tls.Config) Option

type Server

type Server interface {
	Initialize() error
	Serve() error
	Stop() error
	GetPort() int
}

type Session

type Session interface {
	InitializeSession() error
	HandleStartup(dbList database.DatabaseList) error
	QueriesMachine(ctx context.Context) (err error)
	ErrorHandle(err error)
}

type SessionFactory

type SessionFactory interface {
	NewSession(conn net.Conn, log logger.Logger, sysDb database.DB, tlsConfig *tls.Config) Session
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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