kodi

package
v0.0.0-...-656448c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	AlbumID int    `json:"albumid"`
	Label   string `json:"label,omitempty"`
}

type AlbumsResponse

type AlbumsResponse struct {
	Albums []Album             `json:"albums,omitempty"`
	Limits *ListLimitsReturned `json:"limits,omitempty"`
}

type Artist

type Artist struct {
	Artist   string `json:"artist,omitempty"`
	ArtistID int    `json:"artistid"`
	Label    string `json:"label,omitempty"`
}

Artist define the Kodi artist entity

type ArtistsResponse

type ArtistsResponse struct {
	Artists []Artist            `json:"artists,omitempty"`
	Limits  *ListLimitsReturned `json:"limits,omitempty"`
}

ArtistsResponse define the Kodi artists list response

type AudioGetAlbumsResponse

type AudioGetAlbumsResponse struct {
	ResponseBase
	Result AlbumsResponse `json:"result,omitempty"`
}

type AudioGetArtistsResponse

type AudioGetArtistsResponse struct {
	ResponseBase
	Result ArtistsResponse `json:"result,omitempty"`
}

AudioGetArtistsResponse define the response to the GetArtists RPC call

type AudioGetSongsResponse

type AudioGetSongsResponse struct {
	ResponseBase
	Result SongsResponse `json:"result,omitempty"`
}

type Client

type Client struct {
	URI      string
	Username string
	Password string
	Client   *http.Client
}

Client defines the Kodi API client

func NewClient

func NewClient(address string, username string, password string) (*Client, error)

NewClient defines a new client for the Kodi JSONRPC API

func (*Client) AudioGetAlbums

func (k *Client) AudioGetAlbums() (*AudioGetAlbumsResponse, error)

AudioGetAlbums make a RPC call to retrieve all albums

func (*Client) AudioGetArtists

func (k *Client) AudioGetArtists() (*AudioGetArtistsResponse, error)

AudioGetArtists make a RPC call to retrieve all artists

func (*Client) AudioGetSongs

func (k *Client) AudioGetSongs() (*AudioGetSongsResponse, error)

AudioGetSongs make a RPC call to retrieve all songs

func (*Client) Ping

func (k *Client) Ping() (*PingResponse, error)

Ping make a RPC call to the Ping responsder

func (*Client) ShowNotification

func (k *Client) ShowNotification(title string, message string) (*ShowNotificationResponse, error)

ShowNotification make a RPC call to shows a GUI notification

func (*Client) VideoGetMovies

func (k *Client) VideoGetMovies() (*VideoGetMoviesResponse, error)

VideoGetMovies make a RPC call to retrieve all movies

func (*Client) VideoGetMoviesGenres

func (k *Client) VideoGetMoviesGenres() (*VideoGetGenresResponse, error)

VideoGetMoviesGenres make a RPC call to retrieve all genres for movies

func (*Client) VideoGetTVShows

func (k *Client) VideoGetTVShows() (*VideoGetTVShowsResponse, error)

VideoGetTVShows make a RPC call to retrieve all TV shows

func (*Client) VideoGetTVShowsGenres

func (k *Client) VideoGetTVShowsGenres() (*VideoGetGenresResponse, error)

VideoGetTVShowsGenres make a RPC call to retrieve all genres for TV shows

type ErrorData

type ErrorData struct {
	Method string      `json:"method"`
	Stack  *ErrorStack `json:"stack"`
}

ErrorData define some additional information about the error.

type ErrorStack

type ErrorStack struct {
	Name     string      `json:"name,omitempty"`
	Type     string      `json:"type,omitempty"`
	Message  string      `json:"message,omitempty"`
	Property *ErrorStack `json:"property,omitempty"`
}

ErrorStack define sonme errors informations

type Genre

type Genre struct {
	GenreID int    `json:"genreid"`
	Label   string `json:"label,omitempty"`
}

type GenresResponse

type GenresResponse struct {
	Genres []Genre             `json:"genres,omitempty"`
	Limits *ListLimitsReturned `json:"limits,omitempty"`
}

type ListLimitsReturned

type ListLimitsReturned struct {
	Total int `json:"total"`
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

ListLimitsReturned define a Kodi entity for list informations

type Movie

type Movie struct {
	MovieID int    `json:"movieid"`
	Label   string `json:"label,omitempty"`
}

type MoviesResponse

type MoviesResponse struct {
	Movies []Movie             `json:"movies,omitempty"`
	Limits *ListLimitsReturned `json:"limits,omitempty"`
}

type PingResponse

type PingResponse struct {
	ResponseBase
	Result string `json:"result,omitempty"`
}

PingResponse define a response after a Ping RPC call

type Request

type Request struct {
	Jsonrpc string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	ID      int64       `json:"id"`
	Params  interface{} `json:"params,omitempty"`
}

Request define the object sended to the server for the JSONRPC call

type ResponseBase

type ResponseBase struct {
	Jsonrpc string         `json:"jsonrpc,omitempty"`
	Method  string         `json:"method,omitempty"`
	ID      int64          `json:"id,omitempty"`
	Error   *ResponseError `json:"error,omitempty"`
}

ResponseBase define the base JSON object response after a JSONRPC call

type ResponseError

type ResponseError struct {
	Code    int        `json:"code"`
	Message string     `json:"message"`
	Data    *ErrorData `json:"data,omitempty"`
}

ResponseError define the error member of the response when a rpc call encounters an error

type ShowNotificationResponse

type ShowNotificationResponse struct {
	ResponseBase
	Result string `json:"result,omitempty"`
}

ShowNotificationResponse define a response after a ShowNotification RPC call

type Song

type Song struct {
	SongID int    `json:"songid"`
	Label  string `json:"label,omitempty"`
}

type SongsResponse

type SongsResponse struct {
	Songs  []Song              `json:"songs,omitempty"`
	Limits *ListLimitsReturned `json:"limits,omitempty"`
}

type TVShow

type TVShow struct {
	TVShowID int    `json:"tvshowid"`
	Label    string `json:"label,omitempty"`
}

type TVShowsResponse

type TVShowsResponse struct {
	TVShows []TVShow            `json:"tvshows,omitempty"`
	Limits  *ListLimitsReturned `json:"limits,omitempty"`
}

type VideoGetGenresResponse

type VideoGetGenresResponse struct {
	ResponseBase
	Result GenresResponse `json:"result,omitempty"`
}

type VideoGetMoviesResponse

type VideoGetMoviesResponse struct {
	ResponseBase
	Result MoviesResponse `json:"result,omitempty"`
}

type VideoGetTVShowsResponse

type VideoGetTVShowsResponse struct {
	ResponseBase
	Result TVShowsResponse `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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