sdb

package
v0.0.0-...-0000000 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2013 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

This package is in an experimental state, and does not currently follow conventions and style of the rest of goamz or common Go conventions. It must be polished before it's considered a first-class package in goamz.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Name  string
	Value string
}

The Attr type represent categories of data that can be assigned to items.

type AttrsResp

type AttrsResp struct {
	Attrs            []Attr `xml:"GetAttributesResult>Attribute"`
	ResponseMetadata ResponseMetadata
}

Response to an Attrs request.

See http://goo.gl/45X1M for more details.

type Domain

type Domain struct {
	*SDB
	Name string
}

The Domain type represents a collection of items that are described by name-value attributes.

func (*Domain) CreateDomain

func (domain *Domain) CreateDomain() (resp *SimpleResp, err error)

CreateDomain creates a new domain.

See http://goo.gl/jDjGH for more details.

func (*Domain) DeleteDomain

func (domain *Domain) DeleteDomain() (resp *SimpleResp, err error)

DeleteDomain deletes an existing domain.

See http://goo.gl/S0dCL for more details.

func (*Domain) Item

func (domain *Domain) Item(name string) *Item

Item returns an Item with the given name.

type Error

type Error struct {
	StatusCode int     // HTTP status code (200, 403, ...)
	StatusMsg  string  // HTTP status message ("Service Unavailable", "Bad Request", ...)
	Code       string  // SimpleDB error code ("InvalidParameterValue", ...)
	Message    string  // The human-oriented error message
	RequestId  string  // A unique ID for this request
	BoxUsage   float64 // The measure of machine utilization for this request.
}

Error encapsulates an error returned by SDB.

func (*Error) Error

func (err *Error) Error() string

type Item

type Item struct {
	*SDB
	*Domain
	Name string
}

The Item type represent individual objects that contain one or more name-value attributes stored within a SDB Domain as rows.

func (*Item) Attrs

func (item *Item) Attrs(names []string, consistent bool) (resp *AttrsResp, err error)

Attrs returns one or more of the named attributes, or all of item's attributes if names is nil. If consistent is true, previous writes will necessarily be observed.

See http://goo.gl/45X1M for more details.

func (*Item) PutAttrs

func (item *Item) PutAttrs(attrs *PutAttrs) (resp *SimpleResp, err error)

PutAttrs adds attrs to item.

See http://goo.gl/yTAV4 for more details.

type ListDomainsResp

type ListDomainsResp struct {
	Domains          []string `xml:"ListDomainsResult>DomainName"`
	NextToken        string   `xml:"ListDomainsResult>NextToken"`
	ResponseMetadata ResponseMetadata
}

Response to a ListDomains request.

See http://goo.gl/3u0Cf for more details.

type PutAttrs

type PutAttrs struct {
	// contains filtered or unexported fields
}

func (*PutAttrs) Add

func (pa *PutAttrs) Add(name, value string)

func (*PutAttrs) IfMissing

func (pa *PutAttrs) IfMissing(name string)

Flag to test the existence of an attribute while performing conditional updates. X can be any positive integer or 0.

This should set Expected.N.Name=name and Expected.N.Exists=false

func (*PutAttrs) IfValue

func (pa *PutAttrs) IfValue(name, value string)

The PutAttrs request will only succeed if the existing item in SimpleDB contains a matching name / value pair.

func (*PutAttrs) Replace

func (pa *PutAttrs) Replace(name, value string)

type ResponseMetadata

type ResponseMetadata struct {
	RequestId string  // A unique ID for tracking the request
	BoxUsage  float64 // The measure of machine utilization for this request.
}

ResponseMetadata

type SDB

type SDB struct {
	aws.Auth
	aws.Region
	// contains filtered or unexported fields
}

The SDB type encapsulates operations with a specific SimpleDB region.

func New

func New(auth aws.Auth, region aws.Region) *SDB

New creates a new SDB.

func (*SDB) Domain

func (sdb *SDB) Domain(name string) *Domain

Domain returns a Domain with the given name.

func (*SDB) ListDomains

func (sdb *SDB) ListDomains() (resp *ListDomainsResp, err error)

ListDomains lists all domains in sdb.

See http://goo.gl/Dsw15 for more details.

func (*SDB) ListDomainsN

func (sdb *SDB) ListDomainsN(maxDomains int, nextToken string) (resp *ListDomainsResp, err error)

ListDomainsN lists domains in sdb up to maxDomains. If nextToken is not empty, domains listed will start at the given token.

See http://goo.gl/Dsw15 for more details.

func (*SDB) Select

func (sdb *SDB) Select(expr string, consistent bool) (resp *SelectResp, err error)

Select returns a set of items and attributes that match expr. Select is similar to the standard SQL SELECT statement.

See http://goo.gl/GTsSZ for more details.

type SelectResp

type SelectResp struct {
	Items []struct {
		Name  string
		Attrs []Attr `xml:"Attribute"`
	} `xml:"SelectResult>Item"`
	ResponseMetadata ResponseMetadata
}

Response to a Select request.

See http://goo.gl/GTsSZ for more details.

type SimpleResp

type SimpleResp struct {
	ResponseMetadata ResponseMetadata
}

SimpleResp represents a response to an SDB request which on success will return no other information besides ResponseMetadata.

Jump to

Keyboard shortcuts

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