server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConnectionFactory added in v0.5.2

func WithConnectionFactory(f ServerConnectionFactoryFunc) func(*Server) error

WithConnectionFactory is a functional option that allows to set custom connection factory function. This function is used to create new connection with custom options (e.g. custom message length reader/writer)

func WithErrorHandler added in v0.8.0

func WithErrorHandler(f ErrorHandler) func(*Server) error

Types

type ConnectHandler added in v0.3.0

type ConnectHandler func(conn net.Conn)

ConnectHandler is a function that will be called when new connection is established. Note, that this function will be called in a separate goroutine and the conn type is net.Conn, not *connection.Connection

type ErrorHandler added in v0.8.0

type ErrorHandler func(err error)

ErrorHandler is a function that will be called when error occurs during connection handling. Note, that this function may be called from different goroutines, so it must be thread-safe

type Server

type Server struct {
	Addr string
	// contains filtered or unexported fields
}

Server is a simple iso8583 server implementation currently used to test iso8583-client and most probably to be used for iso8583-test-harness

func New

func New(spec *iso8583.MessageSpec, mlReader connection.MessageLengthReader, mlWriter connection.MessageLengthWriter, connectionOpts ...connection.Option) *Server

func (*Server) AddConnectionHandler added in v0.3.0

func (s *Server) AddConnectionHandler(h ConnectHandler)

func (*Server) Close

func (s *Server) Close()

func (*Server) SetOptions added in v0.5.2

func (s *Server) SetOptions(opts ...func(*Server) error) error

func (*Server) Start

func (s *Server) Start(addr string) error

type ServerConnectionFactoryFunc added in v0.5.2

type ServerConnectionFactoryFunc func(conn net.Conn) (*connection.Connection, error)

ServerConnectionFactoryFunc is a function that creates new connection from net.Conn. This function is used to create new connection with custom options (e.g. custom message length reader/writer)

Jump to

Keyboard shortcuts

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