Discover Packages
github.com/acomagu/chatroom-go-v2
chatroom
package
Version:
v0.0.0-...-340bb57
Opens a new window with list of versions in this module.
Published: Aug 19, 2017
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Chatroom struct {
Room
}
A Chatroom has all functions and channels to be exported from this package.
New creates and initialize a Chatroom. This also starts a go-routine to pass messages to Topics.
A DidTalk means whether the Topic talks with user. A Topic function must return this type value.
type Room struct {
In chan interface{}
Out chan interface{}
}
A Room has functions to wait or send messages with user. This is passed to Topic function as argument.
Topic type is the function express a bunch of flow in chattting. Pass slice of this to New(), and the function called them in order. If one of them returns true, the loop breaks.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.