bms

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetShowtimeURL

func GetShowtimeURL(venueCode, sessionID string) (*url.URL, error)

GetShowtimeURL returns booking URL for a specific Show

Types

type Categories

type Categories struct {
	AreaCatCode  string
	PriceDesc    string
	CurPrice     string
	SeatsAvail   string
	SeatLayout   string
	MaxSeats     string
	PercentAvail string
	PriceCode    string

	CategoryRange string
	// contains filtered or unexported fields
}

Categories for a show

type ChildEvent

type ChildEvent struct {
	Name      string `json:"EventName"`
	Language  string `json:"EventLanguage"`
	Dimension string `json:"EventDimension"`
	Code      string `json:"EventCode"`
	Synopsis  string `json:"EventSynopsis"`
	URL       string `json:"EventURL"`
}

ChildEvent can be multiple children of an Event (Movie) containing different languages/dimensions events

type Cinemas

type Cinemas struct {
	BookMyShow struct {
		AIVN []RegionalCinemaDetail
	} `json:"BookMyShow"`
}

Cinemas is the "cinemas" field from QUICKBOOK response

type Client

type Client struct {
	RegionCode string
	RegionName string
	HTTPClient *http.Client
}

Client is a general struct

func NewClient

func NewClient(RegionCode, RegionName string) (*Client, error)

NewClient instantiates a Client struct with a Region Code and Region Name

Example:

c := bms.NewClient("MUMBAI", "Mumbai")

func (*Client) GetEventCode

func (c *Client) GetEventCode(movieName, language, dimension string) (string, error)

GetEventCode returns an Event code for a given movie

func (*Client) GetMovieURL

func (c *Client) GetMovieURL(movieName, language, dimension string, date time.Time) (*url.URL, error)

GetMovieURL returns a URL to a movie's main BMS page.

Language can be:

Hindi, English, Tamil, Telugu, Kannada, Gujarati or anything else BookMyShow supports

Dimensions can be:

2D, 2D 4DX, 3D, 3D 4DX, IMAX 3D or any other that BookMyShow supports

func (*Client) GetQuickbook

func (c *Client) GetQuickbook(eventType string) (*QuickBook, error)

GetQuickbook returns a slice of Event objects

eventType can be:

MT(Movies), CT(Concerts or Misc Events), PL(Plays), SP(Sports)

As of right now, the package only supports MT (Movies)

func (*Client) GetShowtimes

func (c *Client) GetShowtimes(eventCode, venueCode string, date time.Time) ([]Show, error)

GetShowtimes returns a slice of Showtimes (ArrShows) for a movie at a particular venue (theater) on a particular date.

func (*Client) ListMovieTitles

func (c *Client) ListMovieTitles() ([]string, error)

ListMovieTitles returns a slice of movie titles

func (*Client) ListPreferredCinemas

func (c *Client) ListPreferredCinemas() (*PopularCinemas, error)

ListPreferredCinemas returns a list of popular cinemas in your region

func (*Client) ListTheaters

func (c *Client) ListTheaters() ([]RegionalCinemaDetail, error)

ListTheaters returns slice of Cinemas in your region

type Event

type Event struct {
	Title       string       `json:"EventTitle"`
	Code        string       `json:"EventCode"`
	ChildEvents []ChildEvent `json:"ChildEvents"`
}

Event is a movie object

type MoviesData

type MoviesData struct {
	BookMyShow struct {
		ArrEvents []Event `json:"arrEvents"`
	} `json:"BookMyShow"`
}

MoviesData is the "moviesData" field from QUICKBOOK response

type PopularCinemas

type PopularCinemas struct {
	Popular map[string]PrefferedCinemaDetail `json:"popular"`
}

PopularCinemas is the GETPREFFEREDCINEMAS endpoint response

type PrefferedCinemaDetail

type PrefferedCinemaDetail struct {
	VenueCode  string `json:"venueCode"`
	VenueName  string `json:"venueName"`
	RegionCode string `json:"regionCode"`
	RegionName string `json:"regionName"`
}

PrefferedCinemaDetail contains information regarding Theaters

type QuickBook

type QuickBook struct {
	MovieData *MoviesData `json:"moviesData"`
	Cinemas   *Cinemas    `json:"cinemas"`
}

QuickBook is the response from QUICKBOOK endpoint

type RegionDetails

type RegionDetails struct {
	Code  string `json:"code"`
	Name  string `json:"name"`
	Alias string `json:"alias"`
}

type RegionalCinemaDetail

type RegionalCinemaDetail struct {
	IsATMOSEnabled string `json:"IsATMOSEnabled"`
	Address        string `json:"VenueAddress"`
	Code           string `json:"VenueCode"`
	Latitude       string `json:"VenueLatitude"`
	Longitude      string `json:"VenueLongitude"`
	Name           string `json:"VenueName"`
	SubRegionCode  string `json:"VenueSubRegionCode"`
	SubRegionName  string `json:"VenueSubRegionName"`
}

RegionalCinemaDetail contains information regarding Theaters in a region

type Regions

type Regions map[string][]RegionDetails

Regions from GETREGIONS endpoint

func ListRegions

func ListRegions() (*Regions, error)

ListRegions returns Region list including the name, code and alias of a region from GETREGIONS Endpoint

Example:

		regions, err := bms.ListRegions()
		if err != nil {
			log.Print(err)
}
		for _, region := range *regions {
  		fmt.Println(region[0].Name)
		}

type Show

type Show struct {
	SessionID       string `json:"SessionId"`
	ShowDateCode    string
	ShowTimeDisplay string
	Categories      []Categories `json:"Categories"`
}

Show contains info for a particular movie show

type Showtimes

type Showtimes struct {
	BookMyShow struct {
		ArrShows []Show `json:"arrShows"`
	} `json:"BookMyShow"`
}

Showtimes contains lists of shows returned by GETSHOWTIMESBYEVENTANDVENUE endpoint

Jump to

Keyboard shortcuts

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