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
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) SetOptions ¶ added in v0.5.2
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)