api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2015 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Usher = UsherAPI{}
	API   = TwitchAPI{http.DefaultClient}
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Links struct {
		Self    string `json:"self"`
		Channel string `json:"channel"`
	} `json:"_links"`
	Stream *Stream `json:"stream"`
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type Stream

type Stream struct {
	ID        int64     `json:"_id"`
	Game      string    `json:"game"`
	CreatedAt time.Time `json:"created_at"`
	Data      struct {
		Name   string `json:"display_name"`
		Status string `json:"status"`
	} `json:"channel"`
}

type Token

type Token struct {
	Body             string `json:"token"`
	Sig              string `json:"sig"`
	MobileRestricted bool   `json:"mobile_restricted"`
}

func (Token) Values

func (tok Token) Values() (u url.Values)

type TokenType

type TokenType string
const (
	TokenVideo TokenType = "vods"
	TokenLive  TokenType = "channels"
)

type TwitchAPI

type TwitchAPI struct {
	// contains filtered or unexported fields
}

func (TwitchAPI) Channel

func (api TwitchAPI) Channel(name string) (channel Channel, err error)

func (TwitchAPI) IsLive

func (api TwitchAPI) IsLive(channelName string) (live bool, err error)

func (TwitchAPI) Token

func (api TwitchAPI) Token(t TokenType, value string) (token Token, err error)

func (TwitchAPI) TokenURL

func (api TwitchAPI) TokenURL(endpoint, asset string, params url.Values) (u *url.URL)

func (TwitchAPI) URL

func (api TwitchAPI) URL(endpoint string, params url.Values) (u *url.URL)

type UsherAPI

type UsherAPI struct{}

func (UsherAPI) Channel

func (api UsherAPI) Channel(name string, params url.Values) (u *url.URL)

func (UsherAPI) URL

func (api UsherAPI) URL(endpoint string, params url.Values) (u *url.URL)

func (UsherAPI) Video

func (api UsherAPI) Video(video_id string, params url.Values) (u *url.URL)

Jump to

Keyboard shortcuts

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