mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-27 17:28:11 -07:00
organize server command into phases
This commit is contained in:
+17
-2
@@ -18,6 +18,8 @@ type ModeOp rune
|
||||
// user mode flags
|
||||
type UserMode rune
|
||||
|
||||
type Phase uint
|
||||
|
||||
func (mode UserMode) String() string {
|
||||
return fmt.Sprintf("%c", mode)
|
||||
}
|
||||
@@ -125,15 +127,28 @@ type Reply interface {
|
||||
Source() Identifier
|
||||
}
|
||||
|
||||
// commands the server understands
|
||||
// TODO rename ServerCommand
|
||||
type Command interface {
|
||||
Name() string
|
||||
Client() *Client
|
||||
Source() Identifier
|
||||
Reply(Reply)
|
||||
}
|
||||
|
||||
type ServerCommand interface {
|
||||
Command
|
||||
HandleServer(*Server)
|
||||
}
|
||||
|
||||
type AuthServerCommand interface {
|
||||
Command
|
||||
HandleAuthServer(*Server)
|
||||
}
|
||||
|
||||
type RegServerCommand interface {
|
||||
Command
|
||||
HandleRegServer(*Server)
|
||||
}
|
||||
|
||||
type ChannelCommand interface {
|
||||
Command
|
||||
HandleChannel(channel *Channel)
|
||||
|
||||
Reference in New Issue
Block a user