Documentation ¶
Index ¶
- Variables
- type Conn
- type EventError
- type QueryHandler
- type QueryManager
- func (c *QueryManager) HandleFunc(handler QueryHandler)
- func (c *QueryManager) ID() string
- func (c *QueryManager) Query(query string, payload []byte) (message.Awaiter, error)
- func (c *QueryManager) Send(m *message.Message) error
- func (c *QueryManager) Start()
- func (c *QueryManager) Type() message.SubscriberType
- type Service
- type StatusInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = &EventError{Status: 400, Message: "The request was invalid or cannot be otherwise served."} ErrPaymentRequired = &EventError{Status: 402, Message: "The request can not be served, as the payment is required to proceed."} ErrForbidden = &EventError{Status: 403, Message: "The request is understood, but it has been refused or access is not allowed."} ErrNotFound = &EventError{Status: 404, Message: "The resource requested does not exist."} ErrServerError = &EventError{Status: 500, Message: "An unexpected condition was encountered and no more specific message is suitable."} ErrNotImplemented = &EventError{Status: 501, Message: "The server either does not recognize the request method, or it lacks the ability to fulfill the request."} )
Represents a set of errors used in the handlers.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn represents an incoming connection.
func (*Conn) Type ¶
func (c *Conn) Type() message.SubscriberType
Type returns the type of the subscriber
type EventError ¶
EventError represents an event code which provides a more de.
type QueryHandler ¶
QueryHandler represents a query handler.
type QueryManager ¶
type QueryManager struct {
// contains filtered or unexported fields
}
QueryManager represents a request-response manager.
func (*QueryManager) HandleFunc ¶
func (c *QueryManager) HandleFunc(handler QueryHandler)
HandleFunc adds a handler for a query.
func (*QueryManager) ID ¶
func (c *QueryManager) ID() string
ID returns the unique identifier of the subsriber.
func (*QueryManager) Send ¶
func (c *QueryManager) Send(m *message.Message) error
Send occurs when we have received a message.
func (*QueryManager) Start ¶
func (c *QueryManager) Start()
Start subscribes the manager to the query channel.
func (*QueryManager) Type ¶
func (c *QueryManager) Type() message.SubscriberType
Type returns the type of the subscriber
type Service ¶
type Service struct { Closing chan bool // The channel for closing signal. Cipher *security.Cipher // The cipher to use for decoding and encoding keys. License *security.License // The licence for this emitter server. Config *config.Config // The configuration for the service. // contains filtered or unexported fields }
Service represents the main structure.
func NewService ¶
NewService creates a new service.
type StatusInfo ¶
type StatusInfo struct { Node string `json:"node"` Addr string `json:"addr"` Subscriptions int `json:"subs"` Connections int64 `json:"conns"` CPU float64 `json:"cpu"` MemoryPrivate int64 `json:"priv"` MemoryVirtual int64 `json:"virt"` Time time.Time `json:"time"` NumPeers int `json:"peers"` Uptime float64 `json:"uptime"` }
StatusInfo represents the status payload.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.