utils

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2015 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Configuration and methods for the basics of idok.

There are methods to check if user pressed CTRL+C, if Kodi/XBMC is playing, and so on

Index

Constants

View Source
const (
	// message to send to stop media
	STOPBODY = `{"id":1,"jsonrpc":"2.0","method":"Player.Stop","params":{"playerid": %d}}`

	// get player id
	GETPLAYERBODY = `{"id":1, "jsonrpc":"2.0","method":"Player.GetActivePlayers"}`

	// the message to lauch local media
	BODY = `{
	"id":1,"jsonrpc":"2.0",
	"method":"Player.Open",
	"params": {
		"item": {
		   "file": "%s"
		 }
	 }
 }`

	YOUTUBEAPI = `` /* 155-byte string literal not displayed */

)
View Source
const REPO = "https://api.github.com/repos/metal3d/idok/releases"
View Source
const TICK_CHECK = 1

Variables

This section is empty.

Functions

func CheckLocalConfigFiles

func CheckLocalConfigFiles() (string, bool)

Try to get config files

func GetLocalInterfaceIP

func GetLocalInterfaceIP() (string, error)

return local ip that matches kodi network ignoring loopback and other net interfaces

func IsOtherScheme

func IsOtherScheme(query string) (isscheme bool, islocal bool)

check other stream return values are "is other scheme" and "is local"

func IsYoutubeURL

func IsYoutubeURL(query string) (bool, string)

check if argument is a youtube url

func LoadLocalConfig

func LoadLocalConfig(filename string, config *Config)

func OnQuit

func OnQuit()

when quiting (CTRL+C for example) - tell to XBMC to stop.

func PlayYoutube

func PlayYoutube(vidid string) <-chan int

Ask to play youtube video.

func PrintExampleConfig

func PrintExampleConfig()

func Send

func Send(scheme, host, file string, port int) <-chan int

Send the play command to Kodi/XBMC.

func SendBasicStream

func SendBasicStream(uri string, local bool) <-chan int

send basic stream...

func SetTarget

func SetTarget(conf *Config)

Set the target host, port and ssh jsonrpc user/pass

func Usage

func Usage()

Usage() prints command line documentation

Types

type Config

type Config struct {
	// target ip or hostname
	Target string

	// target jsonrpc port
	Targetport int

	// Kodi Username
	User string

	// Kodi password
	Password string

	// host url to jsonrpc
	JsonRPC string

	// Local port if computer should serve
	Localport int

	// SSH port
	Sshport int

	// SSH user
	Sshuser string

	// SSHPassord
	Sshpassword string

	// Use SSH to stream
	Ssh bool

	// Check for new release
	ReleaseCheck bool
}
var GlobalConfig *Config

type Release

type Release struct {
	Url     string `json:"html_url"`
	TagName string `json:"tag_name"`
	Pre     bool   `json:"prerelease"`
}

func CheckRelease

func CheckRelease() (*Release, error)

Jump to

Keyboard shortcuts

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