Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) AddGrant()
- func (c *Client) ApplyCap(cap string, remove bool)
- func (c *Client) ApplyMode(m mode.Mode) bool
- func (c *Client) CapsSet() string
- func (c *Client) Certificate() ([]byte, error)
- func (c *Client) CertificateFingerprint() (string, error)
- func (c *Client) CertificateSha() ([sha256.Size]byte, error)
- func (c *Client) Close() error
- func (c *Client) FillGrants()
- func (c *Client) HasMessageTags() bool
- func (c *Client) Id() string
- func (c *Client) IdleTime() time.Time
- func (c *Client) Is(m Mode) bool
- func (c *Client) IsSecure() bool
- func (c *Client) ReadMsg() ([]byte, error)
- func (c *Client) RemoteAddr() net.Addr
- func (c *Client) SetMode(m Mode)
- func (c *Client) String() string
- func (c *Client) SupportsCapVersion(v int) bool
- func (c *Client) UnsetMode(m Mode)
- func (c *Client) UpdateIdleTime(t time.Time)
- func (c *Client) Write(b []byte) (int, error)
- func (c *Client) WriteMessage(m msg.Msg)
- func (c *Client) WriteMessageFrom(m msg.Msg, from *Client)
- type Mode
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFlood = errors.New("Flooding")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Nick string User string Realname string Host string // uxin timestamp when client first connects JoinTime int64 Mode Mode AwayMsg string ServerPassAccepted bool RegSuspended bool // Represents a set of IRCv3 capabilities Caps map[string]bool // The maximum CAP version that this client supports. If no version is // explicity requested, this will be 0. CapVersion int // Mechanism that is currently in use for this client SASLMech sasl.Mechanism // True if this client has authenticated using SASL IsAuthenticated bool // used to signal when client has successfully responded to server PING PONG chan struct{} AuthCtx []byte // contains filtered or unexported fields }
func (*Client) AddGrant ¶
func (c *Client) AddGrant()
Increment the grant counter by 1. If the client already has max grants, this does nothing.
func (*Client) ApplyMode ¶
given a modeStr, apply the modes to c. If one of the runes does not correspond to a user mode, return it
func (*Client) Certificate ¶
func (*Client) CertificateFingerprint ¶
return a hex string of the sha256 hash of the client's tls certificate. if the client is not connected via tls, or they have not provided a cert, return nil.
func (*Client) FillGrants ¶
func (c *Client) FillGrants()
FillGrants fills the clients grant queue to the max.
func (*Client) HasMessageTags ¶
func (*Client) Id ¶
An Id is used anywhere where a nick is requested in a reply. If Client.Nick is not set yet, then Id returns "*" as a generic placeholder.
func (*Client) ReadMsg ¶
Read until encountering a newline. If the client does not have any grants left, this returns an error.
func (*Client) RemoteAddr ¶
func (*Client) SupportsCapVersion ¶
func (*Client) UpdateIdleTime ¶
func (*Client) WriteMessage ¶
Click to show internal directories.
Click to hide internal directories.