Documentation
¶
Index ¶
- Constants
- func Command(cfg *Config, action epp.Action, extensions ...epp.Extension) (epp.Body, error)
- func ErrorResponse(cfg *Config, err error) epp.Body
- func Greeting(cfg *Config) (epp.Body, error)
- func Login(cfg *Config, clientID, password string, newPassword *string) (epp.Body, error)
- func Logout(cfg *Config) (epp.Body, error)
- type Client
- type Config
- type ContextDialer
- type DuplicateTransactionIDError
- type Error
- type Options
- type Session
- type TransactionIDError
Constants ¶
const ErrClosedConnection stringError = "operation on closed connection"
ErrClosedConnection indicates a read or write operation on a closed connection.
const ErrServerClosed stringError = "server closed"
ErrServerClosed indicates a [Server] has shut down or closed.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // Login(username, password, newPassword string) error // Logout() error Close() error }
type Config ¶
type Config struct { // Supported EPP version(s). Typically this should not be set by either // a client or server. If nil, this will default to []string{"1.0"} // (currently the only supported version). Versions []string // BCP 47 language code(s) for human-readable messages. For clients, // this describes the desired language(s) in preferred order. If the // server does not support any of the client’s preferred languages, the // first language advertised by the server will be selected. For // servers, this describes its supported language(s). If nil, // []string{"en"} will be used. Languages []string // Objects is a list of XML namespace URIs enumerating the EPP objects // supported by the client or server. // // For clients, this describes the object type(s) the client wants to // access. // // For servers, this describes the object type(s) the server allows // clients to access. // // If nil, a reasonable set of defaults will be used. Objects []string // Extensions is a list of XML namespace URIs enumerating the EPP // extensions supported by the client or server. // // For clients, this is a list of extensions(s) the client wants to use // in preferred order. If nil, a client will use its preferred version // of each supported extension announced by the server. // // For servers, this is list of announced extension(s). // // If nil, no EPP extensions will be used. Extensions []string // UnannouncedExtensions contains one or more EPP extensions to be used even if // the peer does not announce support for it. This is used as a // workaround for EPP servers that incorrectly announce the extensions // they support. // // This value should typically be left nil. This will always be nil when // read from a peer. UnannouncedExtensions []string // Schemas contains the list of [schema.Schema] that maps object and extension // namespaces to Go types. // // If nil or empty, reasonable defaults will be used. Schemas []schema.Schema // TransactionID, if not nil, returns unique values used for client or // server transaction IDs. For clients, this generates command // transaction IDs. For servers, this generates response transaction // IDs. // // The function must be safe to call from multiple goroutines. // // If nil, a sequential transaction ID with a random prefix will be // used. TransactionID func() string }
Config describes the configuration of an EPP client or server, including EPP objects and extensions used for a connection.
func ConfigForGreeting ¶
ConfigForGreeting returns a client-centric Config sharing the mutual capabilities announced in an epp.Greeting. If the Config or Greeting do not share a mutual set of EPP versions, languages, and objects, it will return an error. The resulting Config is suitable for creating EPP elements transmittable to the server that sent the Greeting.
TODO: implement this function.
func ConfigForLogin ¶
ConfigForLogin returns a server-centric Config sharing the mutual capabilities announced in an epp.Login. If the Config or Login do not share a mutual set of EPP versions, languages, and objects, it will return an error. The resulting Config is suitable for creating EPP elements transmittable to the client that generated the Login.
The error returned may be an *epp.Result which can be transmitted back to an EPP client in an epp.Response.
TODO: implement this function.
type ContextDialer ¶
type ContextDialer = config.ContextDialer
ContextDialer is any type with a DialContext method that returns (net.Conn, [error]).
type DuplicateTransactionIDError ¶
type DuplicateTransactionIDError TransactionIDError
DuplicateTransactionIDError indicates a duplicate transaction ID.
func (DuplicateTransactionIDError) Error ¶
func (err DuplicateTransactionIDError) Error() string
Error implements the error interface.
type Error ¶
type Error interface {
// contains filtered or unexported methods
}
Error is the interface implemented by all errors in this package.
type Options ¶
Options configure [TODO] with specific features.
func WithContext ¶
func WithDialer ¶
func WithDialer(d ContextDialer) Options
func WithKeepAlive ¶
func WithPipeline ¶
func WithSchema ¶
func WithTimeout ¶
type Session ¶
type Session interface { // Context returns the connection Context for this session. The Context // will be canceled if the underlying connection goes away or is closed. Context() context.Context // ReadCommand reads the next EPP command from the client. An error will // be returned if the underlying connection is closed or an error occurs // reading from the connection. ReadCommand() (*epp.Command, error) // WriteResponse sends an EPP response to the client. An error will // be returned if the underlying connection is closed or an error occurs // writing to the connection. WriteResponse(*epp.Response) error // Close closes the session and the underlying connection. Close() error }
type TransactionIDError ¶
type TransactionIDError struct {
TransactionID string
}
TransactionIDError indicates an invalid transaction ID.
func (TransactionIDError) Error ¶
func (err TransactionIDError) Error() string
Error implements the error interface.