Documentation ¶
Index ¶
- Constants
- func DownloadBook(irc *irc.Conn, book string)
- func DownloadExtractDCCString(baseDir, dccStr string, progress io.Writer) (string, error)
- func Join(irc *irc.Conn, address string, enableTLS bool) error
- func ParseSearch(reader io.Reader) ([]BookDetail, []ParseError)
- func ParseSearchFile(filePath string) ([]BookDetail, []ParseError, error)
- func ParseSearchV2(reader io.Reader) ([]BookDetail, []ParseError)
- func SearchBook(irc *irc.Conn, searchBot string, query string)
- func SendVersionInfo(irc *irc.Conn, line string, version string)
- func StartReader(ctx context.Context, irc *irc.Conn, handler EventHandler)
- type BookDetail
- type EventHandler
- type HandlerFunc
- type IrcServers
- type ParseError
Constants ¶
View Source
const ( Message = event(1) SearchResult = event(2) BookResult = event(3) NoResults = event(4) BadServer = event(5) SearchAccepted = event(6) MatchesFound = event(7) ServerList = event(8) Ping = event(9) Version = event(10) )
Variables ¶
This section is empty.
Functions ¶
func DownloadBook ¶
DownloadBook sends the book string to the download bot
func ParseSearch ¶
func ParseSearch(reader io.Reader) ([]BookDetail, []ParseError)
func ParseSearchFile ¶
func ParseSearchFile(filePath string) ([]BookDetail, []ParseError, error)
ParseSearchFile converts a single search file into an array of BookDetail
func ParseSearchV2 ¶
func ParseSearchV2(reader io.Reader) ([]BookDetail, []ParseError)
func SearchBook ¶
SearchBook sends a search query to the search bot
func SendVersionInfo ¶
Send a CTCP Version response
func StartReader ¶
func StartReader(ctx context.Context, irc *irc.Conn, handler EventHandler)
Types ¶
type BookDetail ¶
type BookDetail struct { Server string `json:"server"` Author string `json:"author"` Title string `json:"title"` Format string `json:"format"` Size string `json:"size"` Full string `json:"full"` }
BookDetail contains the details of a single Book found on the IRC server
type EventHandler ¶
type EventHandler map[event]HandlerFunc
type HandlerFunc ¶
type HandlerFunc func(text string)
type IrcServers ¶
type IrcServers struct { ElevatedUsers []string `json:"elevatedUsers"` RegularUsers []string `json:"regularUsers"` }
func ParseServers ¶
func ParseServers(rawString string) IrcServers
ParseServers parses the complete list of IRC users to get the elevated users which in this case are the download servers
type ParseError ¶
func (*ParseError) MarshalJSON ¶
func (p *ParseError) MarshalJSON() ([]byte, error)
func (ParseError) String ¶
func (p ParseError) String() string
Click to show internal directories.
Click to hide internal directories.