Documentation ¶
Index ¶
- func ArchiveOffer(offer_slug string) (bool, string)
- func DeleteAuthToken(auth_token string) (bool, string)
- func GetCurrentAuthToken() string
- func GetNewAuthToken(username, password string) (string, bool, string)
- func InitGomojoWithAuthToken(api_ver, app_id, auth_token string)
- func InitGomojoWithUserPass(api_ver, app_id, username, password string)
- func SetCurrentAuthToken(auth_token string)
- func UploadFile(file_path string) (bool, string, string, string)
- type ArchiveResponse
- type AuthResponse
- type DeAuthResponse
- type FileUploadResonse
- type ListOffersResponse
- type Offer
- type OfferDetailsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveOffer ¶
ArchiveOffer: archives an existing Offer Inputs: (Offer Slug string) Returns: (API success bool, Message string)
func DeleteAuthToken ¶
DeleteAuthToken: deletes an existing Auth Token Inputs: (Auth Token string) Returns: (API success bool, Message string)
func GetCurrentAuthToken ¶
func GetCurrentAuthToken() string
GetCurrentAuthToken: returns the current Auth Token Inputs: None Returns (Auth Token string)
func GetNewAuthToken ¶
GetNewAuthToken: gets a new Auth Token Inputs: (Username string, Password string) Returns: (Auth Token string, API success bool, Message string)
func InitGomojoWithAuthToken ¶
func InitGomojoWithAuthToken(api_ver, app_id, auth_token string)
InitGomojoWithAuthToken: Initialize gomojo with Auth Token Inputs: (API version string, App ID string, Auth Token string)
func InitGomojoWithUserPass ¶
func InitGomojoWithUserPass(api_ver, app_id, username, password string)
initGomojoWithUserPass: Initialize gomojo with username/password Inputs: (API version string, App ID string, Username string, Password string) Note: The username/password are internally stored in gomojo variables until the first attempt to call an API. Afterwards, these internal variables are blanked out.
func SetCurrentAuthToken ¶
func SetCurrentAuthToken(auth_token string)
SetCurrentAuthToken: sets the current Auth Token Inputs: (Auth Token string)
Types ¶
type ArchiveResponse ¶
ArchiveResponse: represents response of 'archiveoffer' DELETE API
type AuthResponse ¶
type AuthResponse struct { Token string `json:"token"` Message string `json:"message"` Success bool `json:"success"` }
AuthResponse: represents response of 'auth' POST API
type DeAuthResponse ¶
DeAuthResponse: represents response of 'auth' DELETE API
type FileUploadResonse ¶
type FileUploadResonse struct { UploadURL string `json:"upload_url"` Message string `json:"message"` Success bool `json:"success"` UploadJSON string // Additional field populated later with upload response JSON }
FileUploadResonse: represents response of 'getfileuploadurl' POST API
type ListOffersResponse ¶
type ListOffersResponse struct { Offers []Offer `json:"offers"` Success bool `json:"success"` Message string `json:"message"` }
ListOffersResponse: represents response of 'offer' API
type Offer ¶
type Offer struct { ShortURL string `json:"shorturl"` Title string `json:"title"` Slug string `json:"slug"` Status string `json:"status"` Description string `json:"description"` Currency string `json:"currency"` BasePrice string `json:"base_price"` Quantity string `json:"quantity"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` Timezone string `json:"timezone"` Venue string `json:"venue"` RedirectURL string `json:"redirect_url"` Note string `json:"note"` FileUploadJSON string `json:"file_upload_json"` CoverImageJSON string `json:"cover_image_json"` }
Offer: represents one Offer object (in list of offers) This is an amalgamation of the fields received as a result of various APIs (Offers List / Offer Details) Note that Offers List API doesn't populate everything.
func CreateOffer ¶
CreateOffer: create a new offer Inputs: (Offer object) Returns: (Offer object, API success bool, Message string)
func GetOfferDetails ¶
GetOfferDetails: retrieves the details of a particular offer Inputs: (Offer-Slug string) Returns: (Offer object, API success bool, Message string)
func ListOffers ¶
ListOffers: retrieves the list of all offers created under the given App(ID) Inputs: None Returns: (Offer object array, API success bool, Message string)
type OfferDetailsResponse ¶
type OfferDetailsResponse struct { Offer Offer `json:"offer"` Success bool `json:"success"` Message string `json:"message"` }
OfferDetailsResponse: represents response of 'offer' details,'createoffer','updateoffer' API