ilayer

package
v0.0.0-...-a211759 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2020 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Server Server
	Conn   *irc.Conn
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn *irc.Conn, serverAddr, clientAddr string) *Client

func (*Client) Channels

func (c *Client) Channels() []string

func (*Client) ClientPrefix

func (c *Client) ClientPrefix() *irc.Prefix

func (*Client) HandleMessage

func (c *Client) HandleMessage(msg *irc.Message) error

func (*Client) HasCapability

func (c *Client) HasCapability(capability string) bool

func (*Client) InChannel

func (c *Client) InChannel(channel string) bool

func (*Client) IsRegistered

func (c *Client) IsRegistered() bool

func (*Client) Join

func (c *Client) Join(channel, topic string, created time.Time,
	names []string) error

func (*Client) Message

func (c *Client) Message(channel, content string, author *irc.Prefix,
	time time.Time) error

func (*Client) Nickname

func (c *Client) Nickname() string

func (*Client) Password

func (c *Client) Password() string

func (*Client) ReadMessage

func (c *Client) ReadMessage() (*irc.Message, error)

func (*Client) Realname

func (c *Client) Realname() string

func (*Client) ServerPrefix

func (c *Client) ServerPrefix() *irc.Prefix

func (*Client) SetClientPrefix

func (c *Client) SetClientPrefix(prefix *irc.Prefix)

Can only be called before registration completes

func (*Client) SetNickname

func (c *Client) SetNickname(nickname string) error

func (*Client) SetServerPrefix

func (c *Client) SetServerPrefix(prefix *irc.Prefix)

func (*Client) Username

func (c *Client) Username() string

func (*Client) WriteMessage

func (c *Client) WriteMessage(m *irc.Message) error

type ListEntry

type ListEntry struct {
	Channel string
	Users   int
	Topic   string
}

type Server

type Server interface {
	NetworkName() (string, error)
	ServerName() (string, error)
	ServerVersion() (string, error)
	ServerCreated() (time.Time, error)
	MOTD() ([]string, error)

	HandleNickname(nickname string) (string, error) // During registration
	HandleUsername(username string) (string, error) // During registration
	HandleRealname(realname string) (string, error) // During registration
	HandlePassword(password string) (string, error) // During registration
	HandlePing(nonce string) (string, error)        // During registration
	HandleRegister() error                          // During registration

	HandleJoin(channel string) error
	HandleMessage(channel, content string) error
	HandleList() ([]ListEntry, error)
	HandleWhois(user string) (WhoisReply, error)
}

type WhoisReply

type WhoisReply struct {
	Prefix     *irc.Prefix
	Realname   string
	Server     string
	ServerInfo string
	IsOperator bool
	LastActive time.Time
	Channels   []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL