break up types.go

- remove old interfaces, move to relevant files
- remove Phase in favor of a boolean flag
This commit is contained in:
Jeremy Latt 2014-03-12 17:52:25 -07:00
parent 0126edc7af
commit 2006aff9f7
6 changed files with 85 additions and 96 deletions

View file

@ -23,24 +23,6 @@ func (mode UserMode) String() string {
return string(mode)
}
type Phase uint
type ReplyCode interface {
String() string
}
type StringCode string
func (code StringCode) String() string {
return string(code)
}
type NumericCode uint
func (code NumericCode) String() string {
return fmt.Sprintf("%03d", code)
}
// channel mode flags
type ChannelMode rune
@ -143,33 +125,7 @@ func (channels ChannelSet) First() *Channel {
// interfaces
//
type Identifier interface {
type Identifiable interface {
Id() string
Nick() string
}
type Replier interface {
Reply(...string)
}
type Command interface {
Code() StringCode
Client() *Client
SetCode(StringCode)
SetClient(*Client)
}
type ServerCommand interface {
Command
HandleServer(*Server)
}
type AuthServerCommand interface {
Command
HandleAuthServer(*Server)
}
type RegServerCommand interface {
Command
HandleRegServer(*Server)
}