mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
organize server command into phases
This commit is contained in:
parent
29df88fb7a
commit
4d9742d033
5 changed files with 132 additions and 68 deletions
19
irc/types.go
19
irc/types.go
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue