Skip to content

jkrobles/goose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goose

A IRC client library written in Golang

Build Status: Build Status

Examples

Import goose

import (
    "github.com/jkrboles/goose"
)

Anywhere in your code you can create a Goose object. You can then set the parameters, most importantly being Server, Nick and Port. If Channels is empty it will not attempt to join on Connect(). You can issue the Join(channel) function later which will update the Channels array.

    goose := new(goose.Goose)
    goose.Server = "irc.freenode.com"
    goose.Port = "6667"
    goose.Nick = "GooseBot" 
    goose.User = "Goose IRC Client in Go"
    goose.Channels = []string{"#goose"}
    goose.Password = "test" 
    goose.Connect()

Below is an example of a goose loop and how to get the line from the Reader. goose.Pings(line) is required to be ran during every loop iteration. This checks if the current line is a PING and responds with a PONG. Instead of printing the line you can do anything with it like logging.

    for ; goose.Reading() == true;  { 
        line, err := goose.Reader.ReadLine()
        if err != nil { 
           fmt.Println(err)
            break // break loop on errors
         } 
    
         goose.Pings(line)
         fmt.Printf("%s\n", line)

    }

Contributing

If you are interested in contributing to this project whether it be providing test servers or debugging issues you may contact me at justice@justicerobles.com. I look forward to any help.

About

IRC event driven library written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages