goamz
2922
Comment:
|
2922
|
Deletions are marked like this. | Additions are marked like this. |
Line 21: | Line 21: |
http://goneat.org/pkg/launchpad.net/goamz/aws http://goneat.org/pkg/launchpad.net/goamz/ec2 http://goneat.org/pkg/launchpad.net/goamz/s3 |
* http://goneat.org/pkg/launchpad.net/goamz/aws * http://goneat.org/pkg/launchpad.net/goamz/ec2 * http://goneat.org/pkg/launchpad.net/goamz/s3 |
Contents
What is it?
The goamz package enables Go programs to interact with the Amazon Web Services.
It was developed within Canonical as part of an experiment related to using the Go language with the Ensemble project.
The API of AWS is very comprehensive, and goamz doesn't even scratch the surface of it, focusing so far in a few operations to interact with the EC2 and S3 query APIs. That said, it's fairly well tested, and is the foundation in which further calls can easily be integrated. We'll continue extending the API as necessary.
API documentation
The API documentation is currently available at:
Example
Here is a simple example which connects to ZooKeeper, waits for the session to be established, and attempts to create a node:
package main import ( "launchpad.net/goamz/aws" "launchpad.net/goamz/ec2" ) func main() { auth, err := aws.EnvAuth() if err != nil { panic(err.String()) } e := ec2.New(auth, aws.USEast) options := ec2.RunInstances{ ImageId: "ami-ccf405a5", // Ubuntu Maverick, i386, EBS store InstanceType: "t1.micro", } resp, err := e.RunInstances(&options) if err != nil { panic(err.String()) } for _, instance := range resp.Instances { println("Now running", instance.InstanceId) } println("Make sure you terminate instances to stop the cash flow.") }
This example will generate the following output:
Source code
To obtain the source code, use Bazaar to download projects from Launchpad:
$ bzr branch lp:goamz/aws $ bzr branch lp:goamz/ec2 $ bzr branch lp:goamz/s3
Reporting bugs
Please report bugs at:
How to build and install goamz
Use goinstall with the following commands:
$ goinstall launchpad.net/goamz/aws $ goinstall launchpad.net/goamz/ec2 $ goinstall launchpad.net/goamz/s3
Running tests
To run tests, first install gocheck with:
$ goinstall launchpad.net/gocheck
Then run gotest as usual:
$ gotest
If you want to run integration tests (costs money), set up the EC2 environment variables as usual, and run:
$ gotest -i
License
goamz is licensed under the LGPL.
Contact
This project is being developed under the Ensemble project at Canonical.
To get in touch, send a message to the Ensemble mailing list at: <ensemble@lists.ubuntu.com>
goamz (last edited 2015-01-09 12:05:39 by 176-12-31-220)