Documentation ¶
Index ¶
- Variables
- func WaitDuration(notify chan bool, delay time.Duration)
- type EPPServer
- type EPPServerConnection
- func (conn *EPPServerConnection) Close() error
- func (conn *EPPServerConnection) CloseConnection(err error) error
- func (conn *EPPServerConnection) GetNextTransactionID() string
- func (conn *EPPServerConnection) Handle() error
- func (conn *EPPServerConnection) HandleWaitingForClient(timeout chan bool) (state EPPServerState, err error)
- func (conn *EPPServerConnection) HandleWaitingForCommand(timeout chan bool) (state EPPServerState, err error)
- func (conn *EPPServerConnection) Listen() error
- func (conn *EPPServerConnection) Write(b []byte) (n int, err error)
- func (conn *EPPServerConnection) WriteEPP(msg epp.Epp) error
- type EPPServerState
- type LoginObject
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoContactFound = errors.New("no contact found") ErrNoHostFound = errors.New("no host found") ErrNoDomainFound = errors.New("no domain found") ErrClientTimeout = errors.New("client timeout") ErrNotImplemented = errors.New("not implemented") ErrUnhandledTransfer = errors.New("unhandled transfer") )
Functions ¶
func WaitDuration ¶
WaitDuration sleeps for a delay time and then sends a true to the channel provided.
Types ¶
type EPPServer ¶
type EPPServer struct { Host string Port int Timeout time.Duration KillChan chan bool KilledChan chan bool Running chan bool Logins map[string]LoginObject MaxFailedLoginAttempts int NextConnectionID int Contacts map[string]lib.Contact Hosts map[string]lib.Host Domains map[string]lib.Domain Log *logging.Logger // contains filtered or unexported fields }
EPPServer contains the infomration required to run a testing EPP server.
func NewEPPServer ¶
NewEPPServer will take the vital information related to the server like the host address, port and connection timeout duration that it should use for communicating with clients.
func (EPPServer) ContactByID ¶
ContactByID searches for contacts by the RegistryID.
func (EPPServer) DomainByName ¶
DomainByName searches for domain by the DomainName.
func (EPPServer) HostByName ¶
HostByName searches for hosts by the HostName.
type EPPServerConnection ¶
type EPPServerConnection struct { Conn net.Conn Conf *EPPServer RecvChannel chan epp.Epp FailedLoginAttempts int TXID int ConnectionID int LoggedIn *LoginObject Log *logging.Logger }
EPPServerConnection has the required information to handle communication with an epp client.
func (*EPPServerConnection) Close ¶
func (conn *EPPServerConnection) Close() error
Close will close the underlying connection with the client.
func (*EPPServerConnection) CloseConnection ¶
func (conn *EPPServerConnection) CloseConnection(err error) error
CloseConnection closes the socket associated with the connection.
func (*EPPServerConnection) GetNextTransactionID ¶
func (conn *EPPServerConnection) GetNextTransactionID() string
GetNextTransactionID generates a new Transaction ID for the server's commuication.
func (*EPPServerConnection) Handle ¶
func (conn *EPPServerConnection) Handle() error
Handle accepts a new connection and communications with the client.
func (*EPPServerConnection) HandleWaitingForClient ¶
func (conn *EPPServerConnection) HandleWaitingForClient(timeout chan bool) (state EPPServerState, err error)
HandleWaitingForClient handles the Waiting for client state of the EPP Server Connection.
func (*EPPServerConnection) HandleWaitingForCommand ¶
func (conn *EPPServerConnection) HandleWaitingForCommand(timeout chan bool) (state EPPServerState, err error)
HandleWaitingForCommand handles the waiting for command sate of the EPP server connection.
func (*EPPServerConnection) Listen ¶
func (conn *EPPServerConnection) Listen() error
Listen will try to receive messages from the socket associated with a connection.
type EPPServerState ¶
type EPPServerState string
EPPServerState is a type that is used to represent the current state of the EPP server according to the http://tools.ietf.org/html/rfc5730.
var ( // EPPServerPrepareGreeting represents the "Prepare Greeting" state of // RFC5730. EPPServerPrepareGreeting EPPServerState = "PrepareGreeting" // EPPServerWaitingForClient represents the "Waiting For Client // Authentication" state of RFC5730. EPPServerWaitingForClient EPPServerState = "WaitingForClient" // EPPServerWaitingForCommand represents the "Waiting For Command // or hello" state of RFC5730. EPPServerWaitingForCommand EPPServerState = "WaitingForCommand" // EPPServerCloseConnection represents the "End Session" state of // RFC5730. EPPServerCloseConnection EPPServerState = "CloseConnection" )
type LoginObject ¶
LoginObject is used to hold the information about a specific Login in to the epp server.