ohmy

package module
v0.0.0-...-c809f8d Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2014 License: MIT Imports: 9 Imported by: 0

README

ohmy

Go API client for ohmyrockness.com

godoc

GoDoc

Example

package main

import (
    "fmt"

    "github.com/brnstz/ohmy"
)

func main() {
    shows, err := ohmy.GetShows(ohmy.RegionNYC, 100)

    if err == nil {
        fmt.Println(shows[0].Venue.Name, shows[0].Bands[0].Name)
    }
}

Documentation

Overview

Package ohmy pulls data from the ohmyrockness.com API

Index

Constants

View Source
const (
	RegionNYC     Region = 1
	RegionChicago        = 2
	RegionLA             = 3
	RegionSXSW           = 5
)

Variables

View Source
var (
	// NoCSRF is a generic error for any problem getting the CSRF token
	NoCSRF = errors.New("problem getting CSRF token")
)

Functions

This section is empty.

Types

type Band

type Band struct {
	Name string
	Slug string
}

Band is one of the bands playing at the show

type Region

type Region int

Region is where the shows are taking place

type Show

type Show struct {
	Bands  []Band `json:"cached_bands"`
	Venue  Venue
	Starts *time.Time `json:"starts_at"`
}

Show is a list of bands, a venue and some other info. Not everything returned in the API is included here.

type Shows

type Shows []Show

Shows is an array of shows, the response we get from the ohmyrockness API

func GetShows

func GetShows(region Region, n int) (allShows Shows, err error)

GetShows will get at most n number of shows (if less than n available, will give the most available)

type Venue

type Venue struct {
	Address   string `json:"full_address"`
	Latitude  string
	Longitude string
	Name      string
	Slug      string
}

Venue is where the show takes place.

Jump to

Keyboard shortcuts

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