split structs to separate files
This commit is contained in:
parent
d373e9791a
commit
5564eccf22
29
ConnectionMode.go
Normal file
29
ConnectionMode.go
Normal file
@ -0,0 +1,29 @@
|
||||
package libnmdc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ConnectionMode rune
|
||||
|
||||
const (
|
||||
CONNECTIONMODE_ACTIVE ConnectionMode = 'A' // 65
|
||||
CONNECTIONMODE_PASSIVE ConnectionMode = 'P' // 49
|
||||
CONNECTIONMODE_SOCKS5 ConnectionMode = '5' // 53
|
||||
)
|
||||
|
||||
func (this ConnectionMode) String() string {
|
||||
switch this {
|
||||
case CONNECTIONMODE_ACTIVE:
|
||||
return "Active"
|
||||
|
||||
case CONNECTIONMODE_PASSIVE:
|
||||
return "Passive"
|
||||
|
||||
case CONNECTIONMODE_SOCKS5:
|
||||
return "SOCKS5"
|
||||
|
||||
default:
|
||||
return fmt.Sprintf("ConnectionMode(\"%s\")", string(this))
|
||||
}
|
||||
}
|
17
UserFlag.go
Normal file
17
UserFlag.go
Normal file
@ -0,0 +1,17 @@
|
||||
package libnmdc
|
||||
|
||||
type UserFlag byte
|
||||
|
||||
const (
|
||||
FLAG_NORMAL UserFlag = 1
|
||||
FLAG_AWAY_1 UserFlag = 2
|
||||
FLAG_AWAY_2 UserFlag = 3
|
||||
FLAG_SERVER_1 UserFlag = 4
|
||||
FLAG_SERVER_2 UserFlag = 5
|
||||
FLAG_SERVER_AWAY_1 UserFlag = 6
|
||||
FLAG_SERVER_AWAY_2 UserFlag = 7
|
||||
FLAG_FIREBALL_1 UserFlag = 8
|
||||
FLAG_FIREBALL_2 UserFlag = 9
|
||||
FLAG_FIREBALL_AWAY_1 UserFlag = 10
|
||||
FLAG_FIREBALL_AWAY_2 UserFlag = 11
|
||||
)
|
40
UserInfo.go
40
UserInfo.go
@ -9,46 +9,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type UserFlag byte
|
||||
|
||||
const (
|
||||
FLAG_NORMAL UserFlag = 1
|
||||
FLAG_AWAY_1 UserFlag = 2
|
||||
FLAG_AWAY_2 UserFlag = 3
|
||||
FLAG_SERVER_1 UserFlag = 4
|
||||
FLAG_SERVER_2 UserFlag = 5
|
||||
FLAG_SERVER_AWAY_1 UserFlag = 6
|
||||
FLAG_SERVER_AWAY_2 UserFlag = 7
|
||||
FLAG_FIREBALL_1 UserFlag = 8
|
||||
FLAG_FIREBALL_2 UserFlag = 9
|
||||
FLAG_FIREBALL_AWAY_1 UserFlag = 10
|
||||
FLAG_FIREBALL_AWAY_2 UserFlag = 11
|
||||
)
|
||||
|
||||
type ConnectionMode rune
|
||||
|
||||
const (
|
||||
CONNECTIONMODE_ACTIVE ConnectionMode = 'A' // 65
|
||||
CONNECTIONMODE_PASSIVE ConnectionMode = 'P' // 49
|
||||
CONNECTIONMODE_SOCKS5 ConnectionMode = '5' // 53
|
||||
)
|
||||
|
||||
func (this ConnectionMode) String() string {
|
||||
switch this {
|
||||
case CONNECTIONMODE_ACTIVE:
|
||||
return "Active"
|
||||
|
||||
case CONNECTIONMODE_PASSIVE:
|
||||
return "Passive"
|
||||
|
||||
case CONNECTIONMODE_SOCKS5:
|
||||
return "SOCKS5"
|
||||
|
||||
default:
|
||||
return fmt.Sprintf("ConnectionMode(\"%s\")", string(this))
|
||||
}
|
||||
}
|
||||
|
||||
// This structure represents a user connected to a hub.
|
||||
type UserInfo struct {
|
||||
Nick string
|
||||
|
Loading…
Reference in New Issue
Block a user