aws

package module
v0.0.0-...-6567fd2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2014 License: BSD-3-Clause Imports: 11 Imported by: 0

README

AWS Client for Go

Versions

v0.0.2
  • Generate EC2 client code, handles Action and any non-nested []strings
  • Basic query command line for DescribeInstances with InstanceIds
v0.0.1
  • Basic AWS Query V2 signing from github.com/stu-art/awsclient
  • Parse EC2 WSDL
  • Generate valid Go structs from EC2 WSDL

Instructions for v0.0.2

Use gen-main to generate Go code representing EC2 data structures and from the EC2 WSDL.

mkdir -p gen/20140201/ec2
curl -o 2014-02-01-ec2.wsdl 'https://s3.amazonaws.com/ec2-downloads/ec2.wsdl'
go run gen-main/main.go ./2014-02-01-ec2.wsdl > gen/20140201/ec2/ec2.go

Perform a DescribeInstances call

go run client-main/main.go $AWS_ACCESS $AWS_SECRET $REGION $INSTANCEID0 $INSTANCEID1

Instructions for v0.0.1

Use query to sign Query Requests using the Query V2 signing protocol.

go run query/run/main.go $ACCESS $SECRET [$TOKEN]

In v0.0.1, the client does not use the generated code.

Use build to generate Go code representing EC2 data structures from the EC2 WSDL.

mkdir -p gen/20140201/ec2
go run build/run/main.go ./2014-02-01-ec2.wsdl > gen/20140201/ec2/ec2.go

Make sure the data structure is valid Go code.

go run gen/run/main.go

Documentation

Overview

Derived from github.com/stu-art/awsclient/awsclient.go Copyright 2012 Stuart Tettemer and 2014 the aws Authors. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	BINDING     = "binding"
	SERVICE     = "service"
	MESSAGE     = "message"
	OPERATION   = "operation"
	TYPES       = "types"
	SCHEMA      = "schema"
	ELEMENT     = "element"
	COMPLEXTYPE = "complexType"
	GROUP       = "group"
)
View Source
const ACTION_KEY = "Action"
View Source
const ARG_NAME = "prefix"
View Source
const ARG_TYPE = "string"
View Source
const (
	DATETIME = "xs:dateTime"
)
View Source
const IDX_NAME = "i"

TODO import strconv

View Source
const (
	ISO8601 = "2006-01-02T15:04:05Z"
)

Time format constants, see time.Format

View Source
const METH_NAME = "Params"
View Source
const RECV_NAME = "t"
View Source
const RET_NAME = "params"
View Source
const VAL_NAME = "val"

Variables

View Source
var BUILTINS map[string]string
View Source
var BUILTINS_UNQUAL map[string]string

Functions

func QueryString

func QueryString(params ...map[string]string) string

func Resolve

func Resolve(wsdl WSDL) (req, resp map[string][]string)

func ResolveMsg

func ResolveMsg(name string, wsdl WSDL) string

func SignV2

func SignV2(creds Creds, service Service, req map[string]string,
	date time.Time, expires bool) map[string]string

func TypesV2

func TypesV2(name string, wsdl WSDL) *ast.File

func Unqualify

func Unqualify(msg string) string

Types

type Choice

type Choice struct {
	Name string `xml:"name,attr"`
	Type string `xml:"type,attr"`
}

type ComplexType

type ComplexType struct {
	Name    string    `xml:"name,attr"`
	Element []Element `xml:"sequence>element"`
	Group   GroupRef  `xml:"sequence>group"`
	Choice  []Choice  `xml:"sequence>choice>element"`
}

type Creds

type Creds struct {
	Access, Secret, SecurityToken string
}

type Element

type Element struct {
	Name      string `xml:"name,attr"`
	Type      string `xml:"type,attr"`
	MinOccurs string `xml:"minOccurs,attr"`
	MaxOccurs string `xml:"maxOccurs,attr"`
}

type Group

type Group struct {
	Name   string   `xml:"name,attr"`
	Choice []Choice `xml:"choice>element"`
}

type GroupRef

type GroupRef struct {
	Ref string `xml:"ref,attr"`
}

type InputElem

type InputElem struct {
	Message string `xml:"message,attr"`
}

type Message

type Message struct {
	Name string   `xml:"name,attr"`
	Part PartElem `xml:"part"`
}

type Operation

type Operation struct {
	Name   string     `xml:"name,attr"`
	Input  InputElem  `xml:"input"`
	Output OutputElem `xml:"output"`
}

type OutputElem

type OutputElem struct {
	Message string `xml:"message,attr"`
}

type PartElem

type PartElem struct {
	Name    string `xml:"name,attr"`
	Element string `xml:"element,attr"`
}

type Service

type Service struct {
	Name, Region, Endpoint, Version string
}

type WSDL

type WSDL struct {
	Operation   map[string]Operation
	Message     map[string]Message
	Element     map[string]Element
	ComplexType map[string]ComplexType
	Group       map[string]Group
}

func NewWSDL

func NewWSDL(in io.Reader) (WSDL, error)

Directories

Path Synopsis
Derived from http://golang.org/src/pkg/net/url/url.go Copyright 2012 The Go Authors.
Derived from http://golang.org/src/pkg/net/url/url.go Copyright 2012 The Go Authors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL