Documentation ¶
Index ¶
- Constants
- Variables
- func CensorRawMessage(msg string) string
- func IsXML(msg string) bool
- func NewMockTLSConfig() (*tls.Config, error)
- func WithMockServer(port int, f func(server *MockServer) error) error
- type BusinessMessage
- type Client
- func (client *Client) Close() error
- func (client *Client) CurrentRegAccID() (int, error)
- func (client *Client) CurrentUser() string
- func (client *Client) IsLoggedIn() bool
- func (client *Client) Login(username, password string) error
- func (client *Client) Logout() error
- func (client *Client) RemoteAddress() string
- func (client *Client) SendQuery(query *Query) (*Response, error)
- func (client *Client) SendRaw(msg string) (string, error)
- type ClientConfig
- type ContactData
- type ContactType
- type DenicHandle
- type DomainData
- type ErrorPrinter
- type MockQueryHandler
- type MockServer
- type Query
- func NewChangeHolderQuery(domain string, domainData DomainData) *Query
- func NewChangeProviderQuery(domain, authInfo string, domainData DomainData) *Query
- func NewCheckDomainQuery(domain string) *Query
- func NewCheckHandleQuery(handle DenicHandle) *Query
- func NewCreateAuthInfo1Query(domain, authInfo string, expireDay time.Time) *Query
- func NewCreateAuthInfo2Query(domain string) *Query
- func NewCreateContactQuery(handle DenicHandle, contactData ContactData) *Query
- func NewCreateDomainQuery(domain string, domainData DomainData) *Query
- func NewDeleteDomainQuery(domain string) *Query
- func NewInfoDomainQuery(domain string) *Query
- func NewInfoHandleQuery(handle DenicHandle) *Query
- func NewLoginQuery(username, password string) *Query
- func NewLogoutQuery() *Query
- func NewQuery(version Version, action QueryAction, fields QueryFieldList) *Query
- func NewQueueDeleteQuery(msgID, msgType string) *Query
- func NewQueueReadQuery(msgType string) *Query
- func NewRestoreDomainQuery(domain string) *Query
- func NewTransitDomainQuery(domain string, disconnect bool) *Query
- func NewUpdateDomainQuery(domain string, domainData DomainData) *Query
- func ParseQuery(str string) (*Query, error)
- func ParseQueryKV(str string) (*Query, error)
- type QueryAction
- type QueryField
- type QueryFieldList
- func (l *QueryFieldList) Add(fieldName QueryFieldName, values ...string)
- func (l QueryFieldList) CopyTo(dstList *QueryFieldList)
- func (l QueryFieldList) FirstValue(fieldName QueryFieldName) string
- func (l *QueryFieldList) RemoveAll(fieldName QueryFieldName)
- func (l QueryFieldList) Size() int
- func (l QueryFieldList) Values(fieldName QueryFieldName) []string
- type QueryFieldName
- type QueryHandler
- type QueryProcessor
- type RawQueryPrinter
- type Response
- func NewResponse(result Result, fields ResponseFieldList) *Response
- func NewResponseWithError(result Result, fields ResponseFieldList, errors ...BusinessMessage) *Response
- func NewResponseWithInfo(result Result, fields ResponseFieldList, infos ...BusinessMessage) *Response
- func ParseResponse(str string) (*Response, error)
- func ParseResponseKV(msg string) (*Response, error)
- func (r *Response) EncodeKV() string
- func (r *Response) Entities() []ResponseEntity
- func (r *Response) ErrorMessages() []BusinessMessage
- func (r *Response) Field(fieldName ResponseFieldName) []string
- func (r *Response) Fields() ResponseFieldList
- func (r *Response) FirstField(fieldName ResponseFieldName) string
- func (r *Response) InfoMessages() []BusinessMessage
- func (r *Response) IsSuccessful() bool
- func (r *Response) Result() Result
- func (r *Response) STID() string
- func (r *Response) String() string
- func (r *Response) WarningMessages() []BusinessMessage
- type ResponseEntity
- type ResponseEntityName
- type ResponseField
- type ResponseFieldList
- func (l *ResponseFieldList) Add(fieldName ResponseFieldName, values ...string)
- func (l ResponseFieldList) CopyTo(dstList *ResponseFieldList)
- func (l ResponseFieldList) FirstValue(fieldName ResponseFieldName) string
- func (l *ResponseFieldList) RemoveAll(fieldName ResponseFieldName)
- func (l ResponseFieldList) Size() int
- func (l ResponseFieldList) Values(fieldName ResponseFieldName) []string
- type ResponseFieldName
- type Result
- type Server
- type Session
- type TLSConnection
- type TLSDialer
- type Version
Constants ¶
const ( // LatestVersion denotes the latest RRI version supported by the client. LatestVersion Version = "4.0" // QueryFieldNameVersion denotes the query field name for version. QueryFieldNameVersion QueryFieldName = "version" // QueryFieldNameAction denotes the query field name for action. QueryFieldNameAction QueryFieldName = "action" // QueryFieldNameUser denotes the query field name for login user. QueryFieldNameUser QueryFieldName = "user" // QueryFieldNamePassword denotes the query field name for login password. QueryFieldNamePassword QueryFieldName = "password" // QueryFieldNameDomainIDN denotes the query field name for IDN domain name. QueryFieldNameDomainIDN QueryFieldName = "domain" // QueryFieldNameDomainACE denotes the query field name for ACE domain name. QueryFieldNameDomainACE QueryFieldName = "domain-ace" // QueryFieldNameHolder denotes the query field name for holder handle. QueryFieldNameHolder QueryFieldName = "holder" // QueryFieldNameGeneralRequest denotes the query field name for general request handle. QueryFieldNameGeneralRequest QueryFieldName = "generalrequest" // QueryFieldNameAbuseContact denotes the query field name for abuse contact handle. QueryFieldNameAbuseContact QueryFieldName = "abusecontact" // QueryFieldNameNameServer denotes the query field name for name servers. QueryFieldNameNameServer QueryFieldName = "nserver" // QueryFieldNameHandle denotes the query field name for denic handles. QueryFieldNameHandle QueryFieldName = "handle" // QueryFieldNameDisconnect denotes the query field name for disconnect. QueryFieldNameDisconnect QueryFieldName = "disconnect" // QueryFieldNameAuthInfoHash denotes the query field name for auth info hash. QueryFieldNameAuthInfoHash QueryFieldName = "authinfohash" // QueryFieldNameAuthInfoExpire denotes the query field name for auth info expire. QueryFieldNameAuthInfoExpire QueryFieldName = "authinfoexpire" // QueryFieldNameAuthInfo denotes the query field name for auth info hash. QueryFieldNameAuthInfo QueryFieldName = "authinfo" // QueryFieldNameType denotes the query field name for type. QueryFieldNameType QueryFieldName = "type" // QueryFieldNameName denotes the query field name for name. QueryFieldNameName QueryFieldName = "name" // QueryFieldNameOrganisation denotes the query field name for organisation. QueryFieldNameOrganisation QueryFieldName = "organisation" // QueryFieldNameAddress denotes the query field name for address. QueryFieldNameAddress QueryFieldName = "address" // QueryFieldNamePostalCode denotes the query field name for postalcode. QueryFieldNamePostalCode QueryFieldName = "postalcode" // QueryFieldNameCity denotes the query field name for city. QueryFieldNameCity QueryFieldName = "city" // QueryFieldNameCountryCode denotes the query field name for countrycode. QueryFieldNameCountryCode QueryFieldName = "countrycode" // QueryFieldNameEMail denotes the query field name for email. QueryFieldNameEMail QueryFieldName = "email" // QueryFieldNameMsgID denotes the query field name for a message id. QueryFieldNameMsgID QueryFieldName = "msgid" // QueryFieldNameMsgType denotes the query field name for a message type. QueryFieldNameMsgType QueryFieldName = "msgtype" // ActionLogin denotes the action value for login. ActionLogin QueryAction = "LOGIN" // ActionLogout denotes the action value for logout. ActionLogout QueryAction = "LOGOUT" // ActionCheck denotes the action value for check. ActionCheck QueryAction = "CHECK" // ActionInfo denotes the action value for info. ActionInfo QueryAction = "INFO" // ActionCreate denotes the action value for create. ActionCreate QueryAction = "CREATE" // ActionUpdate denotes the action value for update. ActionUpdate QueryAction = "UPDATE" // ActionChangeHolder denotes the action value for change holder. ActionChangeHolder QueryAction = "CHHOLDER" // ActionDelete deontes the action value for delete. ActionDelete QueryAction = "DELETE" // ActionRestore deontes the action value for restore. ActionRestore QueryAction = "RESTORE" // ActionTransit deontes the action value for transit. ActionTransit QueryAction = "TRANSIT" // ActionCreateAuthInfo1 denotes the action value for create AuthInfo1. ActionCreateAuthInfo1 QueryAction = "CREATE-AUTHINFO1" // ActionCreateAuthInfo2 denotes the action value for create AuthInfo2. ActionCreateAuthInfo2 QueryAction = "CREATE-AUTHINFO2" // ActionChangeProvider denotes the action value for change provider. ActionChangeProvider QueryAction = "CHPROV" // ActionQueueRead denotes the action value to read from the registry message queue. ActionQueueRead QueryAction = "QUEUE-READ" // ActionQueueDelete denotes the action value to delete from the registry message queue. ActionQueueDelete QueryAction = "QUEUE-DELETE" // ContactTypePerson denotes a person. ContactTypePerson ContactType = "PERSON" // ContactTypeOrganisation denotes an organisation. ContactTypeOrganisation ContactType = "ORG" // ContactTypeRequest denotes a request contact. ContactTypeRequest ContactType = "REQUEST" )
const ( // ResultSuccess denotes a successful result. ResultSuccess Result = "success" // ResultFailure dontes a failed result. ResultFailure Result = "failure" // ResponseFieldNameResult denotes the response field name for result. ResponseFieldNameResult ResponseFieldName = "RESULT" // ResponseFieldNameSTID denotes the response field name for STID. ResponseFieldNameSTID ResponseFieldName = "STID" // ResponseFieldNameInfo denotes the response field name for info message. ResponseFieldNameInfo ResponseFieldName = "INFO" // ResponseFieldNameError denotes the response field name for error message. ResponseFieldNameError ResponseFieldName = "ERROR" // ResponseFieldNameWarning denotes the response field name for warning message. ResponseFieldNameWarning ResponseFieldName = "WARNING" // ResponseEntityNameHolder denotes the entity name of a holder. ResponseEntityNameHolder ResponseEntityName = "holder" )
Variables ¶
var ( // ErrCloseConnection can be returned by QueryHandler to gracefully close the connection to the client. ErrCloseConnection = fmt.Errorf("gracefully shutdown connection to client") )
Functions ¶
func CensorRawMessage ¶ added in v0.9.9
CensorRawMessage replaces passwords in a raw query with '******'.
func IsXML ¶ added in v0.9.9
IsXML returns whether the message seems to contain a XML encoded query or response.
func NewMockTLSConfig ¶
NewMockTLSConfig returns a new, random TLS key and certificate pair for mock services.
DO NOT USE IN PRODUCTION!
func WithMockServer ¶ added in v0.9.1
func WithMockServer(port int, f func(server *MockServer) error) error
WithMockServer initializes and starts a mock server for the execution of f.
DO NOT USE IN PRODUCTION!
Types ¶
type BusinessMessage ¶ added in v0.9.9
type BusinessMessage struct {
// contains filtered or unexported fields
}
BusinessMessage represents a response message with id as returned in INFO and ERROR.
func NewBusinessMessage ¶ added in v0.9.9
func NewBusinessMessage(id int64, msg string) BusinessMessage
NewBusinessMessage creates a new BusinessMessage with id and message.
func ParseBusinessMessageKV ¶ added in v0.9.9
func ParseBusinessMessageKV(str string) (BusinessMessage, error)
ParseBusinessMessageKV parses a BusinessMessage from a single KV entry.
func (BusinessMessage) ID ¶ added in v0.9.9
func (bm BusinessMessage) ID() int64
ID returns the message id.
func (BusinessMessage) Message ¶ added in v0.9.9
func (bm BusinessMessage) Message() string
Message returns the message string.
func (BusinessMessage) String ¶ added in v0.9.9
func (bm BusinessMessage) String() string
String returns both ID and Message.
type Client ¶
type Client struct { // RawQueryPrinter is called for the raw messages sent and received by the client. RawQueryPrinter RawQueryPrinter // InnerErrorPrinter is called to print uncritical errors that occur internally. InnerErrorPrinter ErrorPrinter // XMLMode controls whether the queries are sent in KeyValue or XML encoding. XMLMode bool // NoAutoRetry can be used to disable automatic retry and login after connection errors. NoAutoRetry bool // contains filtered or unexported fields }
Client represents a stateful connection to a specific RRI Server.
func NewClient ¶
func NewClient(address string, conf *ClientConfig) (*Client, error)
NewClient returns a new Client object for the given RRI Server.
func (*Client) CurrentRegAccID ¶ added in v0.9.3
CurrentRegAccID tries to parse the RegAccID from CurrentUser.
func (*Client) CurrentUser ¶
CurrentUser returns the currently logged in user.
func (*Client) IsLoggedIn ¶
IsLoggedIn returns whether the client is currently logged in.
func (*Client) RemoteAddress ¶
RemoteAddress returns the RRI server address and port.
type ClientConfig ¶ added in v0.9.3
type ClientConfig struct { // TLSDialHandler denotes the TLS dialer to use for the instanced RRI Client. Maps tls.Dial by default. TLSDialHandler TLSDialer // Insecure allows to accept self-signed SSL certificates. Insecure bool // MinTLSVersion denotes the minimum accepted TLS version. MinTLSVersion uint16 }
ClientConfig can be used to further configure the RRI client.
type ContactData ¶ added in v1.11.0
type ContactData struct { Type ContactType Name string Organisation string Address string PostalCode string City string CountryCode string EMail []string }
ContactData holds information of a contact handle.
type ContactType ¶ added in v1.11.0
type ContactType string
ContactType represents the type of a contact handle.
func ParseContactType ¶ added in v1.11.0
func ParseContactType(str string) (ContactType, error)
ParseContactType parses a contact type from string.
func (ContactType) Normalize ¶ added in v1.11.0
func (t ContactType) Normalize() ContactType
Normalize returns the normalized representation of the given ContactType.
type DenicHandle ¶ added in v1.11.0
DenicHandle represents a handle like DENIC-1000006-SOME-CODE
func EmptyDenicHandle ¶ added in v1.11.0
func EmptyDenicHandle() DenicHandle
EmptyDenicHandle returns an empty denic handle.
func NewDenicHandle ¶ added in v1.11.0
func NewDenicHandle(regAccID int, contactCode string) DenicHandle
NewDenicHandle assembles a new denic handle.
func ParseDenicHandle ¶ added in v1.11.0
func ParseDenicHandle(str string) (DenicHandle, error)
ParseDenicHandle tries to parse a handle like DENIC-1000006-SOME-CODE. Returns an empty denic handle if str is empty.
func (DenicHandle) IsEmpty ¶ added in v1.11.0
func (h DenicHandle) IsEmpty() bool
IsEmpty returns true when the given denic handle is unset.
func (DenicHandle) String ¶ added in v1.11.0
func (h DenicHandle) String() string
type DomainData ¶ added in v0.9.9
type DomainData struct { HolderHandles []DenicHandle GeneralRequestHandles []DenicHandle AbuseContactHandles []DenicHandle NameServers []string }
DomainData holds domain information.
type ErrorPrinter ¶ added in v0.9.7
type ErrorPrinter func(err error)
ErrorPrinter is called to print uncritical errors.
type MockQueryHandler ¶ added in v0.9.1
MockQueryHandler is called for every query, except LOGIN and LOGOUT.
type MockServer ¶ added in v0.9.1
type MockServer struct { Handler MockQueryHandler // contains filtered or unexported fields }
MockServer represents a mock RRI server with mocked user authentication.
func NewMockServer ¶ added in v0.9.1
func NewMockServer(port int) (*MockServer, error)
NewMockServer returns a mock server with user authentication for testing.
DO NOT USE IN PRODUCTION!
func (*MockServer) AddUser ¶ added in v0.9.1
func (server *MockServer) AddUser(user, pass string)
AddUser adds a new user with given password or overwrites an existing one.
func (*MockServer) Address ¶ added in v0.9.1
func (server *MockServer) Address() string
Address returns the local address to use for an RRI client.
func (*MockServer) Close ¶ added in v0.9.1
func (server *MockServer) Close() error
Close closes the underlying RRI server.
func (*MockServer) RemoveUser ¶ added in v0.9.1
func (server *MockServer) RemoveUser(user string)
RemoveUser removes a user from the authentication list.
func (*MockServer) Run ¶ added in v0.9.1
func (server *MockServer) Run() error
Run starts the underlying RRI server.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents a RRI request.
func NewChangeHolderQuery ¶ added in v1.10.0
func NewChangeHolderQuery(domain string, domainData DomainData) *Query
NewChangeHolderQuery returns a query to update a domain.
func NewChangeProviderQuery ¶
func NewChangeProviderQuery(domain, authInfo string, domainData DomainData) *Query
NewChangeProviderQuery returns a query to create a domain.
func NewCheckDomainQuery ¶
NewCheckDomainQuery returns a check query.
func NewCheckHandleQuery ¶
func NewCheckHandleQuery(handle DenicHandle) *Query
NewCheckHandleQuery returns a check query for a contact or request contact handle.
func NewCreateAuthInfo1Query ¶
NewCreateAuthInfo1Query returns a create AuthInfo1 query.
func NewCreateAuthInfo2Query ¶
NewCreateAuthInfo2Query returns a create AuthInfo2 query.
func NewCreateContactQuery ¶ added in v1.11.0
func NewCreateContactQuery(handle DenicHandle, contactData ContactData) *Query
NewCreateContactQuery returns a check query.
func NewCreateDomainQuery ¶
func NewCreateDomainQuery(domain string, domainData DomainData) *Query
NewCreateDomainQuery returns a query to create a domain.
func NewDeleteDomainQuery ¶
NewDeleteDomainQuery returns a delete query.
func NewInfoDomainQuery ¶
NewInfoDomainQuery returns an info query.
func NewInfoHandleQuery ¶ added in v0.9.3
func NewInfoHandleQuery(handle DenicHandle) *Query
NewInfoHandleQuery returns an info query for a contact or request contact handle.
func NewLoginQuery ¶
NewLoginQuery returns a login query for the given credentials.
func NewQuery ¶
func NewQuery(version Version, action QueryAction, fields QueryFieldList) *Query
NewQuery returns a query with the given parameters.
func NewQueueDeleteQuery ¶ added in v1.17.0
NewQueueReadQuery returns a query to read from the registry message queue. Use msgType to delete only specific message types or use an empty string to process all message types. This is required if you want to delete the oldest message of a specific type that is not the oldest in your full queue.
func NewQueueReadQuery ¶ added in v1.17.0
NewQueueReadQuery returns a query to read from the registry message queue. Use msgType to filter for specific message types or use an empty string to process all message types.
func NewRestoreDomainQuery ¶
NewRestoreDomainQuery returns a restore query.
func NewTransitDomainQuery ¶ added in v0.9.7
NewTransitDomainQuery returns a restore query.
func NewUpdateDomainQuery ¶
func NewUpdateDomainQuery(domain string, domainData DomainData) *Query
NewUpdateDomainQuery returns a query to update a domain.
func ParseQuery ¶
ParseQuery tries to detect the query format (KV or XML) and returns the parsed query.
func ParseQueryKV ¶
ParseQueryKV parses a single key-value encoded query.
func (*Query) EncodeKV ¶
EncodeKV returns the Key-Value representation as used for RRI communication.
func (*Query) Field ¶
func (q *Query) Field(fieldName QueryFieldName) []string
Field returns all values defined for a field name.
func (*Query) Fields ¶
func (q *Query) Fields() QueryFieldList
Fields returns all additional response fields.
func (*Query) FirstField ¶
func (q *Query) FirstField(fieldName QueryFieldName) string
FirstField returns the first field value or an empty string for a field name.
type QueryAction ¶
type QueryAction string
QueryAction represents the action of a RRI query.
func (QueryAction) Normalize ¶ added in v0.9.1
func (q QueryAction) Normalize() QueryAction
Normalize returns the normalized representation of the given QueryAction.
type QueryField ¶ added in v0.9.1
type QueryField struct { Name QueryFieldName Value string }
QueryField represents a single key-value pair of a query.
type QueryFieldList ¶ added in v0.9.1
type QueryFieldList []QueryField
QueryFieldList contains an ordered list of query fields.
func NewQueryFieldList ¶ added in v0.9.9
func NewQueryFieldList() QueryFieldList
NewQueryFieldList returns an empty query field list.
func (*QueryFieldList) Add ¶ added in v0.9.1
func (l *QueryFieldList) Add(fieldName QueryFieldName, values ...string)
Add adds a sequence of values for the given field name.
func (QueryFieldList) CopyTo ¶ added in v0.9.9
func (l QueryFieldList) CopyTo(dstList *QueryFieldList)
CopyTo appends all values of this list to dstList.
func (QueryFieldList) FirstValue ¶ added in v0.9.1
func (l QueryFieldList) FirstValue(fieldName QueryFieldName) string
FirstValue returns the first field value or an empty string for a field name.
func (*QueryFieldList) RemoveAll ¶ added in v0.9.1
func (l *QueryFieldList) RemoveAll(fieldName QueryFieldName)
RemoveAll removes all values for a given field name
func (QueryFieldList) Size ¶ added in v0.9.9
func (l QueryFieldList) Size() int
Size returns the number of values stored in this list.
func (QueryFieldList) Values ¶ added in v0.9.1
func (l QueryFieldList) Values(fieldName QueryFieldName) []string
Values returns all values defined for a field name.
type QueryFieldName ¶
type QueryFieldName string
QueryFieldName represents a single data field of a query.
func (QueryFieldName) Normalize ¶ added in v0.9.1
func (q QueryFieldName) Normalize() QueryFieldName
Normalize returns the normalized representation of the given QueryFieldName.
type QueryHandler ¶
QueryHandler is called for incoming RRI queryies by the server and expects a result as return value. If an error is returned instead, it is written to log and the connection is closed immmediately.
type QueryProcessor ¶
QueryProcessor is used to process a query directly before sending. The returned query is sent to RRI server. Return nil to abort processing.
type RawQueryPrinter ¶
RawQueryPrinter is called to print a raw outgoing or incoming query string.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response represents an RRI response.
func NewResponse ¶ added in v0.9.9
func NewResponse(result Result, fields ResponseFieldList) *Response
NewResponse returns a new Response with the given result code.
func NewResponseWithError ¶ added in v0.9.9
func NewResponseWithError(result Result, fields ResponseFieldList, errors ...BusinessMessage) *Response
NewResponseWithError returns a new Response with the given result code and attached error messages.
func NewResponseWithInfo ¶ added in v0.9.9
func NewResponseWithInfo(result Result, fields ResponseFieldList, infos ...BusinessMessage) *Response
NewResponseWithInfo returns a new Response with the given result code and attached info messages.
func ParseResponse ¶ added in v0.9.3
ParseResponse tries to detect the response format (KV or XML) and returns the parsed response.
func ParseResponseKV ¶
ParseResponseKV parses a response object from the given key-value response string.
func (*Response) EncodeKV ¶
EncodeKV returns the Key-Value representation as used for RRI communication.
func (*Response) Entities ¶ added in v1.12.0
func (r *Response) Entities() []ResponseEntity
Entities returns a list of entities contained in this response.
func (*Response) ErrorMessages ¶ added in v0.9.9
func (r *Response) ErrorMessages() []BusinessMessage
ErrorMessages returns all error messages.
func (*Response) Field ¶
func (r *Response) Field(fieldName ResponseFieldName) []string
Field returns all values defined for a field name.
func (*Response) Fields ¶
func (r *Response) Fields() ResponseFieldList
Fields returns all additional response fields.
func (*Response) FirstField ¶
func (r *Response) FirstField(fieldName ResponseFieldName) string
FirstField returns the first field value or an empty string for a field name.
func (*Response) InfoMessages ¶ added in v0.9.9
func (r *Response) InfoMessages() []BusinessMessage
InfoMessages returns all info messages.
func (*Response) IsSuccessful ¶
IsSuccessful returns whether the response is successfull.
func (*Response) String ¶ added in v0.9.3
String returns a human readable representation of the response.
func (*Response) WarningMessages ¶ added in v1.17.0
func (r *Response) WarningMessages() []BusinessMessage
WarningMessages returns all warning messages.
type ResponseEntity ¶ added in v1.12.0
type ResponseEntity struct {
// contains filtered or unexported fields
}
ResponseEntity is used to encapsulate further information.
func (*ResponseEntity) Field ¶ added in v1.12.0
func (e *ResponseEntity) Field(fieldName ResponseFieldName) []string
Field returns all values defined for a field name.
func (*ResponseEntity) Fields ¶ added in v1.12.0
func (e *ResponseEntity) Fields() ResponseFieldList
Fields returns all additional response entity fields.
func (*ResponseEntity) FirstField ¶ added in v1.12.0
func (e *ResponseEntity) FirstField(fieldName ResponseFieldName) string
FirstField returns the first field value or an empty string for a field name.
func (*ResponseEntity) Name ¶ added in v1.12.0
func (e *ResponseEntity) Name() ResponseEntityName
Name return the name of this response entity.
type ResponseEntityName ¶ added in v0.9.1
type ResponseEntityName string
ResponseEntityName represents a response entity name.
func (ResponseEntityName) Normalize ¶ added in v0.9.1
func (r ResponseEntityName) Normalize() ResponseEntityName
Normalize returns the normalized representation of the given ResponseEntityName.
type ResponseField ¶ added in v0.9.1
type ResponseField struct { Name ResponseFieldName Value string }
ResponseField represents a single key-value pair of a query.
type ResponseFieldList ¶ added in v0.9.1
type ResponseFieldList []ResponseField
ResponseFieldList contains an ordered list of query fields.
func NewResponseFieldList ¶ added in v0.9.9
func NewResponseFieldList() ResponseFieldList
NewResponseFieldList returns an empty response field list.
func (*ResponseFieldList) Add ¶ added in v0.9.1
func (l *ResponseFieldList) Add(fieldName ResponseFieldName, values ...string)
Add adds a sequence of values for the given field name.
func (ResponseFieldList) CopyTo ¶ added in v0.9.9
func (l ResponseFieldList) CopyTo(dstList *ResponseFieldList)
CopyTo appends all values of this list to dstList.
func (ResponseFieldList) FirstValue ¶ added in v0.9.1
func (l ResponseFieldList) FirstValue(fieldName ResponseFieldName) string
FirstValue returns the first field value or an empty string for a field name.
func (*ResponseFieldList) RemoveAll ¶ added in v0.9.1
func (l *ResponseFieldList) RemoveAll(fieldName ResponseFieldName)
RemoveAll removes all values for a given field name
func (ResponseFieldList) Size ¶ added in v0.9.9
func (l ResponseFieldList) Size() int
Size returns the number of values stored in this list.
func (ResponseFieldList) Values ¶ added in v0.9.1
func (l ResponseFieldList) Values(fieldName ResponseFieldName) []string
Values returns all values defined for a field name.
type ResponseFieldName ¶
type ResponseFieldName string
ResponseFieldName represents the field name of a query response.
func (ResponseFieldName) Normalize ¶ added in v0.9.1
func (r ResponseFieldName) Normalize() ResponseFieldName
Normalize returns the normalized representation of the given ResponseFieldName.
type Server ¶
type Server struct { Handler QueryHandler // contains filtered or unexported fields }
Server represents a basic RRI client to receive RRI queries and send responses.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is used to keep the state of an RRI connection.
type TLSConnection ¶ added in v0.9.9
type TLSConnection interface { io.ReadWriteCloser }
TLSConnection wraps a TLS connection as denoted by *tls.Conn.