lpad

What is it?

The lpad package enables Go programs to very comfortably communicate with the Launchpad API for building reports, task automation, etc.

The package is still evolving, and there are many uncovered aspects in the API, but the current set is already significant and adding support for additional bits is trivial. It's also possible to use the dynamic layer of the package to do any action in the API, despite the existence of a more convenient wrapper or not.

API documentation

The API documentation is comprehensive and is currently available at:

Example

Here is a simple example which connects to authenticates to Launchpad in the command line, waits for the user to confirm the authentication, and then prints the user's name:

package main

import (
    "launchpad.net/lpad"
    "fmt"
)

func main() {
    root, err := lpad.Login(lpad.Production, &lpad.ConsoleOAuth{})
    if err != nil {
        panic(err)
    }
    me, err := root.Me()
    if err != nil {
        panic(err)
    }
    fmt.Println(me.DisplayName())
}

How to build and install

To make use of lpad, just run the following command:

$ go get launchpad.net/lpad

Reporting bugs

Please report bugs at:

Running tests

To run tests, first install gocheck with:

$ go get launchpad.net/gocheck

Then run gotest as usual:

$ gotest

License

lpad is licensed under the LGPL.

Contact

Gustavo Niemeyer <gustavo.niemeyer@canonical.com>

lpad (last edited 2012-03-22 03:11:12 by brad-figg)