Documentation ¶
Index ¶
- func CheckLibsndfileVersion() (float64, error)
- func CheckRoot() bool
- func ConfigToMap(cfg *config.SafeConfig) map[string]interface{}
- func ExecCommand(name string, verbose bool, args ...string) error
- func GetLocalIP() string
- func InitGPIO() error
- func StopGPIO() error
- func TextToFile(text string, filename string) error
- type AudioType
- type Params
- type YouTubeAPIResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckLibsndfileVersion ¶ added in v1.2.0
CheckLibsndfileVersion returns truncated libsndfile1-dev version.
func ConfigToMap ¶ added in v1.3.0
func ConfigToMap(cfg *config.SafeConfig) map[string]interface{}
ConfigToMap converts given config to map. Needs mutex locked!
func ExecCommand ¶ added in v1.3.0
ExecCommand is just exec.Command wrapper.
func GetLocalIP ¶ added in v1.3.0
func GetLocalIP() string
GetLocalIP returns saved local IP or fetches a new one.
func StopGPIO ¶
func StopGPIO() error
StopGPIO closes connection for LEDs and buttons. This function crashes RPi, therefore is not used internally.
func TextToFile ¶ added in v1.3.0
TextToFile saves any given text to given file overwriting it.
Types ¶
type Params ¶ added in v1.3.0
type Params struct { Type AudioType Audio string Cfg *config.SafeConfig }
type YouTubeAPIResult ¶
type YouTubeAPIResult struct { Kind string `json:"kind"` Etag string `json:"etag"` NextPageToken string `json:"nextPageToken"` RegionCode string `json:"regionCode"` PageInfo struct { TotalResults int `json:"totalResults"` ResultsPerPage int `json:"resultsPerPage"` } `json:"pageInfo"` Items []struct { Kind string `json:"kind"` Etag string `json:"etag"` ID struct { Kind string `json:"kind"` VideoID string `json:"videoId"` } `json:"id"` Snippet struct { PublishedAt time.Time `json:"publishedAt"` ChannelID string `json:"channelId"` Title string `json:"title"` Description string `json:"description"` Thumbnails struct { Default struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"default"` Medium struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"medium"` High struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"high"` } `json:"thumbnails"` ChannelTitle string `json:"channelTitle"` LiveBroadcastContent string `json:"liveBroadcastContent"` PublishTime time.Time `json:"publishTime"` } `json:"snippet"` } `json:"items"` }
YouTubeAPIResult is a structure of found videos from YouTube API
func SearchYouTube ¶
func SearchYouTube(query string, apikey string) (YouTubeAPIResult, error)
SearchYouTube queries YouTube API and returns first found video
Click to show internal directories.
Click to hide internal directories.