Documentation ¶
Index ¶
Constants ¶
View Source
const (
ApiPath = "https://api.tripit.com/v1"
)
Variables ¶
View Source
var ( // https://www.tripit.com/developer to register for an API key. ConsumerKey = "" ConsumerSecret = "" )
Functions ¶
func Authorize ¶
func Authorize() *oauth.AccessToken
Types ¶
type AirObject ¶
type AirObject struct { Id string `json:"id"` TripId string `json:"trip_id"` SupplierConfNum string `json:"supplier_conf_num"` // Tripit returns either a list of Segments or a single Segment inline. // The JSON unmarshaler will unmarshal this into a map[key]val or a [map[key]val]]. Segment interface{} }
type DateTime ¶
type ListParameters ¶
type Trip ¶
type Trip struct { Id string `json:"id"` LastModified int64 `json:"last_modified,string"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` DisplayName string `json:"display_name"` ImageUrl string `json:"image_url"` IsPrivate bool `json:"is_private,string"` IsTraveler bool `json:"is_traveler,string"` PrimaryLocation string `json:"primary_location_address"` PrimaryLocationAddress Address TripPurposes TripPurpose // Set by fixStartAndEndDates. ActualStartDate time.Time `json:"-"` ActualEndDate time.Time `json:"-"` }
type TripPurpose ¶
type TripitResponse ¶
type TripitResponse struct { Timestamp int64 `json:"timestamp,string"` NumBytes int64 `json:"num_bytes,string"` PageNum int64 `json:"page_num,string"` PageSize int64 `json:"page_size,string"` MaxPage int64 `json:"max_page,string"` // If you have 1 Trip, the TripIt API does returns a single result and // not a list. Trip []Trip AirObject []AirObject }
type TripitSingleAirObjectResponse ¶
type TripitSingleAirObjectResponse struct {
AirObject AirObject
}
type TripitSingleTripResponse ¶
type TripitSingleTripResponse struct {
Trip Trip
}
Tripit brokenness: it will return a single Trip object (instead of list-of-Trips) if you have one trip upcoming. In some circumstances, it will return a single AirObject instead of a list. Sigh.
type TripitV1API ¶
type TripitV1API struct {
// contains filtered or unexported fields
}
func NewTripitV1API ¶
func NewTripitV1API(at *oauth.AccessToken) *TripitV1API
func (*TripitV1API) List ¶
func (t *TripitV1API) List(p *ListParameters) ([]Trip, error)
func (*TripitV1API) ListRaw ¶
func (t *TripitV1API) ListRaw(p *ListParameters) (*TripitResponse, error)
Lists trips.
Click to show internal directories.
Click to hide internal directories.