Documentation
¶
Index ¶
- Constants
- type Link
- func (l *Link) Notify(message Message) error
- func (l *Link) Register() (Listener, chan Message)
- func (l *Link) Reply(request Message, message Message) error
- func (l *Link) Request(message Message) (Message, error)
- func (l *Link) Serve(stream io.ReadWriter)
- func (l *Link) Shutdown()
- func (l *Link) Unregister(id Listener)
- func (l *Link) Write(message Message) error
- type Listener
- type Message
- type MessageType
Constants ¶
View Source
const ( MessageRequest = iota MessageResponse MessageNotification )
The different message types.
View Source
const ListenerChannelSize = 32
ListenerChannelSize is the size of the channel that is created for each listener.
View Source
const RequestTimeout = 5 * time.Second
RequestTimeout is the time the Request method waits for a response.
View Source
const WriterChannelSize = 32
WriterChannelSize is the size of the writer channel.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link represents a link.
func (*Link) Shutdown ¶
func (l *Link) Shutdown()
Shutdown the link. This does not close the underlying stream.
func (*Link) Unregister ¶
Unregister interest in received messages.
type Message ¶
type Message struct {
Type MessageType
ID uint32
Command string
}
Message contains a parsed representation of a serial message.
Click to show internal directories.
Click to hide internal directories.