userwatch

package
v0.0.0-...-993cae5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMsg

func GetMsg(msg, nick string) string

func InitBot

func InitBot(cfg *irc.Config, b *bot.Bot, conn *ircevent.Connection, cfgfile string) error

Types

type Channel

type Channel struct {
	Users map[string]*User `json:"users"`
	sync.RWMutex
}

func (*Channel) Get

func (c *Channel) Get(nick string) *User

func (*Channel) Has

func (c *Channel) Has(nick string) bool

func (*Channel) Nicks

func (c *Channel) Nicks() []string

type User

type User struct {
	Nick string `json:"-"` // used for internal access, not needed in storage
	JMsg string `json:"jmsg,omitempty"`
	QMsg string `json:"qmsg,omitempty"`
	sync.RWMutex
}

func (*User) GetJMsg

func (u *User) GetJMsg() string

func (*User) GetQMsg

func (u *User) GetQMsg() string

func (*User) SetJMsg

func (u *User) SetJMsg(msg string)

func (*User) SetQMsg

func (u *User) SetQMsg(msg string)

type WatchData

type WatchData struct {
	Modified time.Time           `json:"modified"`
	Channels map[string]*Channel `json:"channels"`
}

func NewWatchData

func NewWatchData() *WatchData

func (*WatchData) Get

func (wd *WatchData) Get(channel string) *Channel

func (*WatchData) Load

func (wd *WatchData) Load(r io.Reader) error

func (*WatchData) LoadFile

func (wd *WatchData) LoadFile(filename string) *WatchData

func (*WatchData) Save

func (wd *WatchData) Save(w io.Writer) (int, error)

func (*WatchData) SaveFile

func (wd *WatchData) SaveFile(filename string) error

Jump to

Keyboard shortcuts

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