Documentation ¶
Index ¶
- Variables
- type Channel
- type Client
- func (c *Client) AddListener(listener MsgListener)
- func (c *Client) Bye() error
- func (c *Client) CloseChan(name string) error
- func (c *Client) Connect(name, address string, port int, password string) error
- func (c *Client) ConnectKnown(name string) error
- func (c *Client) CreateChan(name, address string, port int, password string, timeout int) error
- func (c *Client) CreateConnectChan(name, address string, port int, password string, timeout int) error
- func (c *Client) Die() error
- func (c *Client) Forget(name string) error
- func (c *Client) Identity() Identity
- func (c *Client) List() error
- func (c *Client) ListKnownChan() func(string) []string
- func (c *Client) ListOwnChan() func(string) []string
- func (c *Client) Me() error
- func (c *Client) SendMessage(text string) error
- func (c *Client) String() string
- type IChannel
- type IClient
- type IPipe
- type IRegistry
- type Identity
- type Interceptor
- type KnownChan
- type Message
- type MsgListener
- type Pipe
- type Registry
- type TMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ClientSuicide = errors.New("client doesn't want to live anymore") ErrWrongPassword = errors.New("wrong password") ErrChannel = errors.New("channel error") ErrUnknown = errors.New("unknown error") )
View Source
var ErrPipeClosed error = errors.New("pipe is closed")
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) Join ¶
Join create a pipe between the channel and the given connection and start listening for client message, after executing the authentication procedure (the client must know the protocol)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddListener ¶
func (c *Client) AddListener(listener MsgListener)
func (*Client) ConnectKnown ¶
func (*Client) CreateChan ¶
func (*Client) CreateConnectChan ¶
func (*Client) ListKnownChan ¶
func (*Client) ListOwnChan ¶
func (*Client) SendMessage ¶
type IClient ¶
type IClient interface { Identity() Identity AddListener(listener MsgListener) CreateConnectChan(name, address string, port int, password string, timeout int) error CreateChan(name, address string, port int, password string, timeout int) error Connect(name, address string, port int, password string) error ConnectKnown(name string) error ListKnownChan() func(string) []string ListOwnChan() func(string) []string CloseChan(name string) error Bye() error Die() error Forget(name string) error Me() error List() error SendMessage(text string) error }
type Identity ¶
func NewIdentity ¶
type Interceptor ¶
type Message ¶
type Message struct { // Must be public for marshalling Text string Type TMsg Sender Identity Timestamp time.Time }
func NewMsgPassword ¶
func NewMsgSysChannel ¶
func NewMsgSysClient ¶
func NewMsgText ¶
type MsgListener ¶
type MsgListener func(*Message)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
Source Files ¶
Click to show internal directories.
Click to hide internal directories.