ergo/irc/types.go

52 lines
680 B
Go
Raw Normal View History

package irc
import (
"fmt"
)
2014-02-09 07:42:14 +01:00
//
// simple types
2014-02-09 07:42:14 +01:00
//
2014-02-09 07:42:14 +01:00
// a string with wildcards
type Mask string
// add, remove, list modes
type ModeOp rune
2014-02-09 07:42:14 +01:00
// user mode flags
type UserMode rune
2014-02-09 07:42:14 +01:00
// channel mode flags
type ChannelMode rune
2014-02-09 07:42:14 +01:00
// user-channel mode flags
type UserChannelMode rune
2014-02-09 07:42:14 +01:00
//
// interfaces
2014-02-09 07:42:14 +01:00
//
2014-02-09 07:42:14 +01:00
// commands the server understands
// TODO rename ServerCommand
type Command interface {
Client() *Client
Source() Identifier
Reply(Reply)
HandleServer(*Server)
}
2014-02-09 07:42:14 +01:00
//
// structs
2014-02-09 07:42:14 +01:00
//
type UserMask struct {
nickname Mask
username Mask
hostname Mask
}
func (mask *UserMask) String() string {
return fmt.Sprintf("%s!%s@%s", mask.nickname, mask.username, mask.hostname)
}