1
0
Fork 0
forked from External/ergo

basic capability negotiation

- multi-prefix is supported as an example
This commit is contained in:
Jeremy Latt 2014-02-28 19:21:33 -08:00
parent 542744d52a
commit 36602c9a3c
7 changed files with 206 additions and 100 deletions

View file

@ -10,6 +10,25 @@ import (
// simple types
//
type CapSubCommand string
type Capability string
type CapModifier rune
type CapState uint
type CapabilitySet map[Capability]bool
func (set CapabilitySet) String() string {
strs := make([]string, len(set))
index := 0
for capability := range set {
strs[index] = string(capability)
}
return strings.Join(strs, " ")
}
// a string with wildcards
type Mask string
@ -24,7 +43,7 @@ func (op ModeOp) String() string {
type UserMode rune
func (mode UserMode) String() string {
return fmt.Sprintf("%c", mode)
return string(mode)
}
type Phase uint
@ -49,7 +68,7 @@ func (code NumericCode) String() string {
type ChannelMode rune
func (mode ChannelMode) String() string {
return fmt.Sprintf("%c", mode)
return string(mode)
}
type ChannelNameMap map[string]*Channel