amiando

package module
v0.0.0-...-8d8f1bf Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2012 License: MIT Imports: 9 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go library for the Amiando API

See: http://developers.amiando.com/

Documentation

Overview

Support for the Amiando API.

Used by http://startuplive.in

Index

Constants

View Source
const (
	Male   = 1
	Female = 2
)
View Source
const DateFormat = "2006-01-02T15:04:05"

Variables

This section is empty.

Functions

func PrettifyJSON

func PrettifyJSON(compactJSON []byte) string

Types

type Address

type Address struct {
	Street  string
	Street2 string
	City    string
	ZipCode string
	Country string
}

type Api

type Api struct {
	Key string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(key string) *Api

func (*Api) Call

func (self *Api) Call(resourceFormat string, resourceArg interface{}, result ErrorReporter) (err error)

func (*Api) Call_debug

func (self *Api) Call_debug(resourceFormat string, resourceArg interface{}, result ErrorReporter) (err error)

func (*Api) Payment

func (self *Api) Payment(id ID, out interface{}) (err error)

func (*Api) Ticket

func (self *Api) Ticket(id ID, out interface{}) (err error)

func (*Api) TicketIDsOfPayment

func (self *Api) TicketIDsOfPayment(paymentID ID) (ids []ID, err error)

func (*Api) User

func (self *Api) User(id ID, out interface{}) (err error)

type BasicEventData

type BasicEventData struct {
	HostID                 ID      `json:"hostId"`
	Title                  string  `json:"title"`
	Country                string  `json:"country"`
	Language               string  `json:"language"`
	StartDate              string  `json:"selectedDate"`
	EndDate                string  `json:"selectedEndDate"`
	Timezone               string  `json:"timezone"`
	Visibility             string  `json:"visibility"`
	Identifier             string  `json:"identifier"`
	Description            string  `json:"description"`
	ShortDescription       string  `json:"shortDescription"`
	EventType              string  `json:"eventType"`
	OrganisatorDisplayName string  `json:"organisatorDisplayName"`
	PartnerEventUrl        string  `json:"partnerEventUrl"`
	Location               string  `json:"location"`
	LocationDescription    string  `json:"locationDescription"`
	Street                 string  `json:"street2"`
	ZipCode                string  `json:"zipCode"`
	City                   string  `json:"city"`
	State                  string  `json:"state"`
	CreationTime           string  `json:"creationTime"`
	LastModified           string  `json:"lastModified"`
	Longitude              float64 `json:"longitude"`
	Latitude               float64 `json:"latitude"`
}

type Error

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

func (*Error) Error

func (self *Error) Error() string

type ErrorReporter

type ErrorReporter interface {
	Err() error
	Reset()
}

type Event

type Event struct {
	ResultBase
	Data       BasicEventData `json:"event"`
	Api        *Api           `json:"-"`
	Identifier string         `json:"-"`
	InternalID ID             `json:"-"`
}

func NewEvent

func NewEvent(api *Api, identifier string) (event *Event, err error)

func (*Event) EnumParticipants

func (self *Event) EnumParticipants() (<-chan *Participant, <-chan error)

func (*Event) PaymentIDs

func (self *Event) PaymentIDs() (ids []ID, err error)

func (*Event) Read

func (self *Event) Read(out ErrorReporter) (err error)

func (*Event) TicketIDs

func (self *Event) TicketIDs() (ids []ID, err error)

type ID

type ID int64

func (ID) String

func (self ID) String() string

type JsonResult

type JsonResult struct {
	ResultBase
	JSON []byte
}

Has to be used as a pointer to member of a struct

func (*JsonResult) Reset

func (self *JsonResult) Reset()

func (*JsonResult) String

func (self *JsonResult) String() string

func (*JsonResult) UnmarshalJSON

func (self *JsonResult) UnmarshalJSON(jsonData []byte) error

type Participant

type Participant struct {
	Event *Event `json:"-"`

	PaymentID     ID            `json:"-"`
	PaymentUserID ID            `json:"buyerId"`      // payment
	PaymentStatus PaymentStatus `json:"status"`       // payment
	InvoiceNumber string        `json:"identifier"`   // payment
	CreatedDate   string        `json:"creationTime"` // payment
	ModifiedDate  string        `json:"lastModified"` // payment

	UserData []UserData `json:"userData"` // payment & ticket

	TicketID           ID         `json:"-"`
	FirstName          string     `json:"firstName"`         // ticket
	LastName           string     `json:"lastName"`          // ticket
	Email              string     `json:"email"`             // ticket
	CheckedDate        string     `json:"lastChecked"`       // ticket
	CancelledDate      string     `json:"cancelled"`         // ticket
	TicketType         TicketType `json:"ticketType"`        // ticket
	RegistrationNumber string     `json:"displayIdentifier"` // ticket
}

func (*Participant) FindRequiredUserData

func (self *Participant) FindRequiredUserData(title string, restrictToTypes ...UserDataType) (userData *UserData, err error)

func (*Participant) FindUserData

func (self *Participant) FindUserData(title string, restrictToTypes ...UserDataType) (userData *UserData, found bool)

Returns nil if no UserData with title is found

type PaymentStatus

type PaymentStatus string
const (
	PaymentNew        PaymentStatus = "new"
	PaymentAuthorized PaymentStatus = "authorized"
	PaymentPaid       PaymentStatus = "paid"
	PaymentDisbursed  PaymentStatus = "disbursed"
	PaymentCancelled  PaymentStatus = "cancelled"
)

type ResultBase

type ResultBase struct {
	Success bool     `json:"success"`
	Errors  []string `json:"errors"`
}

func (*ResultBase) Err

func (self *ResultBase) Err() error

func (*ResultBase) Reset

func (self *ResultBase) Reset()

type TicketType

type TicketType string
const (
	BadgeTicket        TicketType = "com.amiando.ticket.type.Badge"        // Means that the ticket is a badge.
	ETicketTicket      TicketType = "com.amiando.ticket.type.ETicket"      // Means that the ticket will be sent via email.
	PaperTicket        TicketType = "com.amiando.ticket.type.Paper"        // Means that the ticket is a confirmation.
	ConfirmationTicket TicketType = "com.amiando.ticket.type.Confirmation" // Means that the payment was bought using prepayment.
	OnSiteTicket       TicketType = "com.amiando.ticket.type.OnSite"       // Means that the ticket was bought via EasyEntry.
)

type UserData

type UserData struct {
	Title string       `json:"title"`
	Type  UserDataType `json:"type"`
	Value interface{}  `json:"value"`
}

func (*UserData) Address

func (self *UserData) Address() *Address

func (*UserData) String

func (self *UserData) String() string

type UserDataType

type UserDataType string
const (
	UserDataString      UserDataType = "string"   // value is of type String.
	UserDataNumber      UserDataType = "number"   // value is of type Integer.
	UserDataDate        UserDataType = "date"     // value is of type Date.
	UserDataGender      UserDataType = "gender"   // value is of type Integer.
	UserDataEmail       UserDataType = "email"    // value is of type String.
	UserDataUrl         UserDataType = "url"      // value is of type String.
	UserDataBirthday    UserDataType = "birthday" // value is of type Date.
	UserDataAddress     UserDataType = "address"  // value is an object of type Address.
	UserDataPhone       UserDataType = "phone"    // value is of type String.
	UserDataZipCode     UserDataType = "zipCode"  // value is of type String.
	UserDataCountry     UserDataType = "country"  // value is of type Country. Country codes are defined by the ISO 3166-1-alpha-2 code standard
	UserDataBlog        UserDataType = "blog"     // value is of type String.
	UserDataCheckbox    UserDataType = "checkbox" // value is of type Bool
	UserDataRadiobutton UserDataType = "radio"    // value is of type String.
	UserDataDropdown    UserDataType = "dropdown" // value is of type String.
	UserDataTextArea    UserDataType = "textarea" // value is of type String.
	UserDataProduct     UserDataType = "product"  // value is of type String.
	UserDataPhoto       UserDataType = "photo"    // value is of type String (URL)
)

Jump to

Keyboard shortcuts

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