Documentation ¶
Overview ¶
Package atheme implements an Atheme XMLRPC client and does all the horrifyingly ugly scraping of the raw output to machine-usable structures.
Index ¶
- Constants
- type Akill
- type Atheme
- type ChanServ
- func (cs *ChanServ) GetAccessList(channel string) (res []Flagset, err error)
- func (cs *ChanServ) GetChannelFlags(channel string) (flags []string, err error)
- func (cs *ChanServ) Info(channel string) (ci *ChannelInfo, err error)
- func (cs *ChanServ) Kick(channel, victim, reason string) (res string, err error)
- func (cs *ChanServ) List() (res []*ChannelInfo, err error)
- func (cs *ChanServ) SetAccessList(channel, target, flags string) (err error)
- func (cs *ChanServ) SetChannelFlag(channel, flag, value string) (err error)
- type ChannelInfo
- type Flagset
- type HostServ
- func (hs *HostServ) Activate(account string) (err error)
- func (hs *HostServ) Assign(account, vhost string) (err error)
- func (hs *HostServ) List() ([]VHost, error)
- func (hs *HostServ) ListPattern(pattern string) (res []VHost, err error)
- func (hs *HostServ) Reject(account, message string) (err error)
- func (hs *HostServ) Request(vhost string) (err error)
- func (hs *HostServ) Revoke(account string) (err error)
- func (hs *HostServ) Waiting() (res []VHost, err error)
- type Memo
- type MemoServ
- type NickServ
- func (ns *NickServ) Info(target string) (res map[string]string, err error)
- func (ns *NickServ) ListAccess(target string) (res NickServFlagset, err error)
- func (ns *NickServ) ListOwnAccess() (res NickServFlagset, err error)
- func (ns *NickServ) OwnInfo() (map[string]string, error)
- func (ns *NickServ) SetEmail(email string) (res string, err error)
- func (ns *NickServ) SetPassword(password string) (res string, err error)
- func (ns *NickServ) UID(account string) (res string, err error)
- type NickServFlagset
- type OperServ
- type VHost
Constants ¶
const ( FaultNEEDMOREPARAMS = iota // Not enough parameters FaultBADPARAMS // Parameters invalid somehow FaultNOSUCHSOURCE // Source account does not exist FaultNOSUCHTARGET // Target does not exist FaultAUTHFAIL // Bad password or authcookie FaultNOPRIVS // Permission denied (not auth) FaultNOSUCHKEY // Requested element on target does not exist FaultALREADYEXISTS // Something conflicting already exists FaultTOOMANY // Too many of something FaultEMAILFAIL // Sending email failed FaultNOTVERIFIED // Account not verified FaultNOCHANGE // Object is already in requested state FaultALREADYAUTHED // Already logged in FaultUNIMPLEMENTED // Function not implemented )
Fault constants from atheme/doc/XMLRPC
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Akill ¶
type Akill struct { Num int `json:"num"` Mask string `json:"mask"` Setter string `json:"setter"` Expiry string `json:"expiry"` Reason string `json:"reason"` }
Akill models an AKILL, also known as a K:Line. This represents a network-wide ban by user@host.
type Atheme ¶
type Atheme struct { Privset []string // Privilege set of the user Account string // Account Atheme is logged in as NickServ *NickServ ChanServ *ChanServ OperServ *OperServ HostServ *HostServ MemoServ *MemoServ LastUsed time.Time // When the last RPC call was made // contains filtered or unexported fields }
Atheme is an Atheme context. This contains everything a client needs to access Atheme data remotely.
func (*Atheme) GetPrivset ¶
GetPrivset returns the privset of a user.
type ChanServ ¶
type ChanServ struct {
// contains filtered or unexported fields
}
ChanServ implements a Golang client to Atheme's ChanServ. This is mostly a port of Cod's string parsing code.
func (*ChanServ) GetAccessList ¶
GetAccessList returns a slice of Flagsets representing the access list of the channel you are requesting. This will fail if the Atheme call fails.
func (*ChanServ) GetChannelFlags ¶
GetChannelFlags returns the SET flags of a channel as a string slice.
func (*ChanServ) Info ¶
func (cs *ChanServ) Info(channel string) (ci *ChannelInfo, err error)
Info gets information on a channel, returning a ChannelInfo struct or an error describing the fault.
func (*ChanServ) Kick ¶
Kick sends a ChanServ KICK command to channel on victim with the denoted reason. You must have a reason for calls made with this function.
func (*ChanServ) List ¶
func (cs *ChanServ) List() (res []*ChannelInfo, err error)
List lists all channels returning a slice of ChannelInfo structs or an error describing the fault.
func (*ChanServ) SetAccessList ¶
SetAccessList commits a flag change on a channel with a given flagset.
func (*ChanServ) SetChannelFlag ¶
SetChannelFlag sets a channel SET flag or returns an error.
type ChannelInfo ¶
type ChannelInfo struct { Name string `json:"name"` // Channel name Mlock string `json:"mlock"` // Channel mode lock Flags []string `json:"flags"` // Channel SET flags Founder string `json:"founder"` // Channel founder Registered string `json:"registered"` // Channel age Description string `json:"description"` // Channel description }
ChannelInfo is the information Atheme has on a channel.
type HostServ ¶
type HostServ struct {
// contains filtered or unexported fields
}
HostServ wraps Atheme's HostServ for use in Go programs.
func (*HostServ) ListPattern ¶
ListPattern returns a list of all the vhosts Atheme is keeping track of that match a given pattern
type Memo ¶
type Memo struct { From string `json:"from"` Date string `json:"date"` Message string `json:"message"` ID int `json:"id"` }
Memo represents a MemoServ memo.
type MemoServ ¶
type MemoServ struct {
// contains filtered or unexported fields
}
MemoServ binds MemoServ RPC calls.
type NickServ ¶
type NickServ struct {
// contains filtered or unexported fields
}
NickServ implements a Golang client to Atheme's NickServ. This is mostly a port of Cod's Atheme parsing code
func (*NickServ) ListAccess ¶
func (ns *NickServ) ListAccess(target string) (res NickServFlagset, err error)
ListAccess lists the channels a user has flags in.
func (*NickServ) ListOwnAccess ¶
func (ns *NickServ) ListOwnAccess() (res NickServFlagset, err error)
ListOwnAccess lists the channels this user has flags in.
func (*NickServ) SetPassword ¶
SetPassword sets the password for an account.
type NickServFlagset ¶
NickServFlagset is a convenience wrapper around a slice of string->string maps.
type OperServ ¶
type OperServ struct {
// contains filtered or unexported fields
}
OperServ models Atheme's OperServ to Golang programs.
func (*OperServ) AkillAdd ¶
AkillAdd adds an Akill to Atheme and returns the struct created by the call.
func (*OperServ) AkillDel ¶
AkillDel attempts to delete an Akill from Atheme and returns an error representing the status of the command.