user

package
v0.0.0-...-4813284 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2014 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPasswordNotVerified = iota
	StatusPasswordVerified
	StatusNotRegistered
	StatusRegistered
	StatusDisconnecting
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int
const (
	ModeAway                     Mode = 1 << 0
	ModeInvisible                Mode = 1 << 1
	ModeReceiveWallops           Mode = 1 << 2
	ModeRestrictedUserConnection Mode = 1 << 3
	ModeOperator                 Mode = 1 << 4
	ModeLocalOperator            Mode = 1 << 5
	ModeReceiveServiceNotice     Mode = 1 << 6
)

func (Mode) String

func (m Mode) String() string

type User

type User struct {
	Config *config.Config // Global Server Config

	Conn net.Conn // Original TCP connection

	Id           int
	UserName     string
	NickName     string
	RealName     string
	HostName     string // Hostname this user try to connect
	LastPongTime int64  // Last time this user reply a PONG message

	In  chan []byte
	Out chan []byte
	// contains filtered or unexported fields
}

func New

func New(cf *config.Config, conn net.Conn) *User

func (*User) AwayMsg

func (u *User) AwayMsg() string

func (*User) ClearMode

func (u *User) ClearMode(m Mode)

func (*User) Close

func (u *User) Close()

func (*User) EnterStatus

func (u *User) EnterStatus(s int)

func (*User) Full

func (u *User) Full() string

func (*User) IsAway

func (u *User) IsAway() bool

func (*User) IsDisconnecting

func (u *User) IsDisconnecting() bool

func (*User) IsPasswordVerified

func (u *User) IsPasswordVerified() bool

func (*User) IsRegistered

func (u *User) IsRegistered() bool

func (*User) MarkAway

func (u *User) MarkAway(b bool)

func (*User) MarkMode

func (u *User) MarkMode(m Mode)

func (*User) Modes

func (u *User) Modes() string

func (*User) SendErrorNeedMoreParams

func (u *User) SendErrorNeedMoreParams(c string)

func (*User) SendMessage

func (u *User) SendMessage(m *message.Message)

func (*User) SendMotd

func (u *User) SendMotd()

func (*User) SendWelcomeMessage

func (u *User) SendWelcomeMessage()

func (*User) SetAwayMsg

func (u *User) SetAwayMsg(s string)

func (*User) Status

func (u *User) Status() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL