go-source is a Go client for the Source RCON Protocol.
go get -u github.com/multiplay/go-source
Using go-source is simple just create a client, login and then send commands e.g.
package main
import (
"log"
"github.com/multiplay/go-source"
)
func main() {
c, err := source.NewClient("192.168.1.102:27015", source.Password("mypass"))
if err != nil {
log.Fatal(err)
}
defer c.Close()
if s, err := c.Exec("status"); err != nil {
log.Fatal(err)
} else {
log.Println("server status:", s)
}
}
go-source is available under the BSD 2-Clause License.