lib

package
v0.0.0-...-5681cd2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvStr

func GetEnvStr(name, def string) (res string)

GetEnvStr returns string for environment string with default

func RefreshToken

func RefreshToken(config *Config, debug bool) (string, error)

RefreshToken ... https://developer.stubhub.com/store/site/pages/doc-tutorials.jag

func SerCookies

func SerCookies(f string, context string, cookies Cookies, config *Config) error

SerCookies ...

Types

type AncestorsJSON

type AncestorsJSON struct {
	Categories []PropertyExJSON `json:"categories"`
	Groupings  []PropertyExJSON `json:"groupings"`
	Performers []PropertyExJSON `json:"performers"`
	Geos       []PropertyExJSON `json:"geos"`
}

AncestorsJSON ...

type AttributeJSON

type AttributeJSON struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

AttributeJSON ...

type Config

type Config struct {
	AccessToken      string
	ApplicationToken string
	CustomerKey      string
	CustomerSecret   string
	ExpiresIn        int
	Password         string
	RefreshToken     string
	Scope            string
	Server           string
	TokenType        string
	UserName         string
	UserID           string
}

Config ...

func Coalesce

func Coalesce(context *Context, cookie *Cookie, env *Env) *Config

Coalesce ...

func (*Config) Freshen

func (c *Config) Freshen(j *LoginJSON, user string)

Freshen ...

func (*Config) String

func (c *Config) String() string

type Context

type Context struct {
	ApplicationToken string `yaml:"application_token"`
	CustomerKey      string `yaml:"customer_key"`
	CustomerSecret   string `yaml:"customer_secret"`
	Password         string `yaml:"password"`
	Scope            string `yaml:"scope"`
	Server           string `yaml:"server"`
	UserName         string `yaml:"user_name"`
}

Context ...

type Contexts

type Contexts map[string]*Context

Contexts ...

func DeserContexts

func DeserContexts(f string) (Contexts, error)

DeserContexts ...

func (Contexts) String

func (c Contexts) String() string
type Cookie struct {
	AccessToken  string `yaml:"access_token"`
	ExpiresIn    int    `yaml:"expires_in"`
	RefreshToken string `yaml:"refresh_token"`
	TokenType    string `yaml:"token_type"`
	UserID       string `yaml:"X-Stubhub-User-Guid"`
}

Cookie ...

type Cookies

type Cookies map[string]*Cookie

Cookies ...

func DeserCookies

func DeserCookies(f string) (Cookies, error)

DeserCookies ...

func (Cookies) String

func (c Cookies) String() string

type DisplayAttributesJSON

type DisplayAttributesJSON struct {
	IsHidden      bool   `json:"isHidden"`
	HideEventDate bool   `json:"hideEventDate"`
	HideEventTime bool   `json:"hideEventTime"`
	PrimaryName   string `json:"primaryName"`
}

DisplayAttributesJSON ...

type Env

type Env struct {
	ApplicationToken string
	CustomerKey      string
	CustomerSecret   string
	Password         string
	UserName         string
}

Env ...

func InitEnv

func InitEnv() (*Env, error)

InitEnv ...

func (*Env) String

func (e *Env) String() string

type EventsJSON

type EventsJSON struct {
	ID                   int                    `json:"id"`
	Status               string                 `json:"status"`
	Locale               string                 `json:"locale"`
	Name                 string                 `json:"name"`
	OriginalName         string                 `json:"originalName"`
	Description          string                 `json:"description"`
	EventURL             string                 `json:"eventUrl"`
	WebURI               string                 `json:"webURI"`
	SeoURI               string                 `json:"seoURI"`
	EventDateLocal       StubhubTime            `json:"eventDateLocal"`
	DateOnsale           StubhubTime            `json:"dateOnsale"`
	EventDateUTC         StubhubTime            `json:"eventDateUTC"`
	Venue                VenueJSON              `json:"venue"`
	VenueConfiguration   VenueConfigurationJSON `json:"venueConfiguration"`
	BobID                int                    `json:"bobId"`
	Ancestors            AncestorsJSON          `json:"ancestors"`
	SourceID             string                 `json:"sourceId"`
	Categories           []PropertyExJSON       `json:"categories"`
	Groupings            []PropertyExJSON       `json:"groupings"`
	Performers           []PropertyExJSON       `json:"performers"`
	Geos                 []PropertyExJSON       `json:"geos"`
	CategoriesCollection []PropertyExJSON       `json:"categoriesCollection"`
	GroupingsCollection  []PropertyExJSON       `json:"groupingsCollection"`
	PerformersCollection []PropertyExJSON       `json:"performersCollection"`
	ImageURL             string                 `json:"imageUrl"`
	Images               []ImageJSON            `json:"images"`
	Attributes           []AttributeJSON        `json:"attributes"`
	DisplayAttributes    DisplayAttributesJSON  `json:"displayAttributes"`
	MobileAttributes     MobileAttributesJSON   `json:"mobileAttributes"`
	Score                float32                `json:"score"`
	CreatedDate          StubhubTime            `json:"createdDate"`
	DefaultLocale        string                 `json:"defaultLocale"`
}

EventsJSON ...

type ImageJSON

type ImageJSON struct {
	URL         string `json:"url"`
	IsResizable bool   `json:"isResizable"`
	URLSSL      string `json:"urlSsl"`
	Height      int    `json:"height"`
	Width       int    `json:"width"`
	Source      string `json:"source"`
	Credit      string `json:"credit"`
}

ImageJSON ...

type ListingErrorJSON

type ListingErrorJSON struct {
	Type      string `json:"type"`
	Code      string `json:"code"`
	Message   string `json:"message"`
	Parameter string `json:"parameter"`
}

ListingErrorJSON ...

type ListingJSON

type ListingJSON struct {
	ID                    string      `json:"id"`
	Status                string      `json:"status"`
	EventID               string      `json:"eventId"`
	EventDescription      string      `json:"eventDescription"`
	EventDate             StubhubTime `json:"eventDate"`
	InHandDate            StubhubTime `json:"inhandDate"`
	Quantity              int         `json:"quantity"`
	QuantityRemain        int         `json:"quantityRemain"`
	Section               string      `json:"section"`
	Rows                  string      `json:"rows"`
	Seats                 string      `json:"seats"`
	VenueDescription      string      `json:"venueDescription"`
	SplitOption           string      `json:"splitOption"`
	SplitQuantity         int         `json:"splitQuantity"`
	DeliveryOption        string      `json:"deliveryOption"`
	PreDelivered          string      `json:"preDelivered"`
	SaleEndDate           StubhubTime `json:"saleEndDate"`
	SaleMethod            string      `json:"saleMethod"`
	PricePerTicket        PriceJSON   `json:"pricePerTicket"`
	PayoutPerTicket       PriceJSON   `json:"payoutPerTicket"`
	DisplayPricePerTicket PriceJSON   `json:"displayPricePerTicket"`
	PaymentType           string      `json:"paymentType"`
}

ListingJSON ...

type ListingsErrorJSON

type ListingsErrorJSON struct {
	Listings ListingsErrorsJSON `json:"listings"`
}

ListingsErrorJSON ...

type ListingsErrorsJSON

type ListingsErrorsJSON struct {
	Errors   []ListingErrorJSON `json:"errors"`
	NumFound int                `json:"numFound"`
}

ListingsErrorsJSON ...

type ListingsJSON

type ListingsJSON struct {
	NumFound int           `json:"numFound"`
	Listings []ListingJSON `json:"listing"`
}

ListingsJSON ...

type ListingsResponseJSON

type ListingsResponseJSON struct {
	Listings ListingsJSON `json:"listings"`
}

ListingsResponseJSON ...

type LoginErrorJSON

type LoginErrorJSON struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

LoginErrorJSON ...

type LoginJSON

type LoginJSON struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
}

LoginJSON ...

type MobileAttributesJSON

type MobileAttributesJSON struct {
	EnableApplePassbook     bool `json:"enableApplePassbook"`
	MobileListingNotAllowed bool `json:"mobileListingNotAllowed"`
	StubhubMobileTicket     bool `json:"stubhubMobileTicket"`
}

MobileAttributesJSON ...

type PointJSON

type PointJSON struct {
	Point string `json:"point"`
}

PointJSON ...

type PriceJSON

type PriceJSON struct {
	Amount   int    `json:"amount"`
	Currency string `json:"currency"`
}

PriceJSON ...

type PropertyExJSON

type PropertyExJSON struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	URL    string `json:"url"`
	WebURI string `json:"webURI"`
	SeoURI string `json:"seoURI"`
}

PropertyExJSON ...

type SearchErrorJSON

type SearchErrorJSON struct {
	Code             string      `json:"code"`
	Description      string      `json:"description"`
	RequestID        string      `json:"requestId"`
	Data             []PointJSON `json:"data"`
	ValidationErrors string      `json:"validationErrors"`
}

SearchErrorJSON ...

type SearchJSON

type SearchJSON struct {
	NumFound int          `json:"numFound"`
	Events   []EventsJSON `json:"events"`
}

SearchJSON ...

type StubhubTime

type StubhubTime struct {
	time.Time
}

StubhubTime ...

func (*StubhubTime) UnmarshalJSON

func (stubhubTime *StubhubTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON ...

type VenueConfigurationJSON

type VenueConfigurationJSON struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

VenueConfigurationJSON ...

type VenueJSON

type VenueJSON struct {
	ID            int     `json:"id"`
	Name          string  `json:"name"`
	URL           string  `json:"url"`
	WebURI        string  `json:"webURI"`
	SeoURI        string  `json:"seoURI"`
	VenueURL      string  `json:"venueUrl"`
	Latitude      float32 `json:"latitude"`
	Longitude     float32 `json:"longitude"`
	Timezone      string  `json:"timezone"`
	JdkTimezone   string  `json:"jdkTimezone"`
	Address1      string  `json:"address1"`
	City          string  `json:"city"`
	State         string  `json:"state"`
	PostalCode    string  `json:"postalCode"`
	Country       string  `json:"country"`
	VenueConfigID int     `json:"venueConfigId"`
}

VenueJSON ...

Jump to

Keyboard shortcuts

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