Documentation ¶
Index ¶
- type APIError
- type Advertiser
- type Banner
- type Campaign
- type CampaignsResult
- type Commissions
- type Paginator
- type Product
- type ProductsResult
- type ProfitShare
- func (ps *ProfitShare) Get(uri string) ([]byte, error)
- func (ps *ProfitShare) GetAdvertisers(from time.Time, to time.Time) ([]Advertiser, error)
- func (ps *ProfitShare) GetAdvertisers1D() ([]Advertiser, error)
- func (ps *ProfitShare) GetAdvertisers1M() ([]Advertiser, error)
- func (ps *ProfitShare) GetCampaignPage(page int) ([]Campaign, Paginator, error)
- func (ps *ProfitShare) GetCampaigns() ([]Campaign, error)
- func (ps *ProfitShare) GetProductPage(advertiserID []int, page int) ([]Product, Paginator, error)
- func (ps *ProfitShare) GetProducts(advertiserID []int) ([]Product, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Error struct { Code string `json:"code"` Message string `json:"message"` } `json:"error"` }
APIError holds API error information
type Advertiser ¶
type Advertiser struct { ID string `json:"id"` Name string `json:"name"` Logo string `json:"logo"` Category string `json:"category"` URL string `json:"url"` LastUpdateProducts string `json:"last_update_products"` Commissions []Commissions `json:"commissions"` }
Advertiser instance
type Campaign ¶
type Campaign struct { ID int `json:"id"` AdvertiserID int `json:"advertiser_id"` Name string `json:"name"` CommissionType string `json:"commissionType"` StartDate string `json:"startDate"` EndDate string `json:"endDate"` PageURL string `json:"url"` Banners map[string]Banner `json:"banners"` }
Campaign holds Campaign information
type CampaignsResult ¶
type CampaignsResult struct { Paginator Paginator `json:"paginator"` Campaigns []Campaign `json:"campaigns"` }
CampaignsResult holds the result of the affiliate-campaigns API call
type Commissions ¶
Commissions instance
type Product ¶
type Product struct { AdvertiserID int `json:"advertiser_id"` AdvertiserName string `json:"advertiser_name"` BrandName string `json:"brand_name"` CategoryName string `json:"category_name"` Description string `json:"description"` FreeShipping int `json:"free_shipping"` Image string `json:"image"` ImageOriginal string `json:"image_original"` LastUpdate string `json:"last_update"` Link string `json:"link"` Name string `json:"name"` PartNumber string `json:"part_number"` Price float64 `json:"price"` PriceDiscounted string `json:"price_discounted"` PriceVat float64 `json:"price_vat"` }
Product holds information about a certain product
type ProductsResult ¶
type ProductsResult struct { Result struct { CurrentPage int `json:"current_page"` RecordsPerPage int `json:"records_per_page"` TotalPages int `json:"total_pages"` Products []Product `json:"products"` } `json:"result"` }
ProductsResult holds the result from the API
type ProfitShare ¶
type ProfitShare struct { // contains filtered or unexported fields }
ProfitShare API instance
func NewProfitShare ¶
func NewProfitShare(user, key string) (ps *ProfitShare)
Creates a new Instance of ProfitShare API
func (*ProfitShare) GetAdvertisers ¶
func (ps *ProfitShare) GetAdvertisers(from time.Time, to time.Time) ([]Advertiser, error)
GetAdvertisers returns a list of advertise from a period of time to another
func (*ProfitShare) GetAdvertisers1D ¶
func (ps *ProfitShare) GetAdvertisers1D() ([]Advertiser, error)
GetAdvertisers1D returns a list of advertisers from a day ago to now
func (*ProfitShare) GetAdvertisers1M ¶
func (ps *ProfitShare) GetAdvertisers1M() ([]Advertiser, error)
GetAdvertisers1M returns a list of advertisers from a month ago to now
func (*ProfitShare) GetCampaignPage ¶
func (ps *ProfitShare) GetCampaignPage(page int) ([]Campaign, Paginator, error)
GetCampaignPage returns all the campaigns from the supplied page
func (*ProfitShare) GetCampaigns ¶
func (ps *ProfitShare) GetCampaigns() ([]Campaign, error)
GetCampaigns returns all the active campaigns
func (*ProfitShare) GetProductPage ¶
GetProductPage returns a list of products and the paginator for a certain page
func (*ProfitShare) GetProducts ¶
func (ps *ProfitShare) GetProducts(advertiserID []int) ([]Product, error)
GetProducts returns a list of all the products by advertiserIds