twitch

package
v0.0.0-...-94f56ab Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppToken

type AppToken struct {
	AccessToken string `json:"access_token"`
}

type Client

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

func NewClient

func NewClient(cfg *config.Authentication) (*Client, error)

func (*Client) GetCommunity

func (c *Client) GetCommunity(name string) (*Community, error)

queries the servers for a specific community based on its name

func (*Client) GetStatistics

func (c *Client) GetStatistics() (*Statistics, error)

func (*Client) GetStreams

func (c *Client) GetStreams(cursor string, communityIds []string, gameIds []string, languages []string) (*StreamPage, error)

func (*Client) GetTopCommunities

func (c *Client) GetTopCommunities(cursor string) (*CommunityPage, error)

queries the servers for a list of top communities

func (*Client) GetTopGames

func (c *Client) GetTopGames(offset uint64) (*TopGamePage, error)

retrieves a list of popular games

func (*Client) GetUsers

func (c *Client) GetUsers(userIds []string) (*UserPage, error)

type Community

type Community struct {
	Id          string `json:"_id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

func (*Community) MarshalJSON

func (c *Community) MarshalJSON() ([]byte, error)

type CommunityPage

type CommunityPage struct {
	OldPage
	Content []*Community `json:"communities"`
}

type Game

type Game struct {
	Id   uint64 `json:"_id"`
	Name string `json:"name"`
}

func (*Game) MarshalJSON

func (g *Game) MarshalJSON() ([]byte, error)

type NewPage

type NewPage struct {
	Pagination NewPagination `json:"pagination"`
}

type NewPagination

type NewPagination struct {
	Cursor string `json:"cursor"`
}

type OldPage

type OldPage struct {
	TotalElements uint64 `json:"_total"`
	Cursor        string `json:"_cursor"`
}

type Statistics

type Statistics struct {
	Channels uint64 `json:"channels"`
	Viewers  uint64 `json:"viewers"`
}

type Stream

type Stream struct {
	Id          string `json:"id"`
	UserId      string `json:"user_id"`
	GameId      string `json:"game_id"`
	Title       string `json:"title"`
	ViewerCount uint64 `json:"viewer_count"`
	Thumbnail   string `json:"thumbnail_url"`
}

type StreamPage

type StreamPage struct {
	NewPage
	Content []*Stream `json:"data"`
}

type TopGame

type TopGame struct {
	Game     *Game  `json:"game"`
	Viewers  uint64 `json:"viewers"`
	Channels uint64 `json:"channels"`
}

type TopGamePage

type TopGamePage struct {
	OldPage
	Content []*TopGame `json:"top"`
}

type User

type User struct {
	Id           string `json:"id"`
	Login        string `json:"login"`
	DisplayName  string `json:"display_name"`
	Description  string `json:"description"`
	ProfileImage string `json:"profile_image_url"`
}

type UserPage

type UserPage struct {
	Content []*User `json:"data"`
}

Jump to

Keyboard shortcuts

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