user

package
v0.0.0-...-df918ef Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: ISC Imports: 4 Imported by: 0

Documentation

Overview

Package user provides some simple IRC user tracking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EphemeralUser

type EphemeralUser struct {
	User
	AuthedForNick bool
	Oper          bool
	OperName      string
}

EphemeralUser represents an IRC user. It is intended ephemeral use on messages. as in, it should be created from a message and optionally augmented with stored data. it should *NOT* be used as a normal user store, as some things that are stored on it may change at any time server side (such as oper status)

There is no promise that anything other than nick/user/host exists.

func FromMessage

func FromMessage(msg *ircmsg.Message, availableCaps []capab.Capability) *EphemeralUser

FromMessage creates an EphemeralUser instance from a message. It will make use of various tags, if offered, to add more information to the struct

type User

type User struct {
	ircmsg.NUH
	RealIP   net.IP
	RealHost string
	RealName string
	Account  string
}

User represents an IRC user, with some optional bits of info, if known

func (*User) Mask

func (u *User) Mask() string

Mask returns a n!u@h mask for the given User instance

Jump to

Keyboard shortcuts

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