internal

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewStreamer

func AddNewStreamer(streamerName string, category string)

AddNewStreamer checks if streamer already exists and adds it if not.

func GetStreamStatus

func GetStreamStatus(userid string) (string, string)

func GetUserId

func GetUserId(username string) (string, error)

func RemoveExistingStreamer added in v0.8.0

func RemoveExistingStreamer(streamerName string)

RemoveExistingStreamer checks if streamer exists and deletes it from the config file.

func RenameCategory added in v0.8.0

func RenameCategory(oldCategoryName string, newCategoryName string)

RenameCategory renames all occurrences of a category.

func RenameStreamer added in v0.8.0

func RenameStreamer(oldStreamerName string, newStreamerName string)

RenameStreamer renames an existing streamer.

func ShowAllStreamers

func ShowAllStreamers()

ShowAllStreamers shows all streamers with their current state.

func ShowStreamersOfCategoryFiltered

func ShowStreamersOfCategoryFiltered(selectedCategory string)

ShowStreamersOfCategoryFiltered shows all streamers of a specified category with their current state.

func UpdateStreamerStatus

func UpdateStreamerStatus(streamer *Streamer) error

Types

type ApiStreamer

type ApiStreamer struct {
	ID              string `json:"id"`
	Login           string `json:"login"`
	DisplayName     string `json:"display_name"`
	Type            string `json:"type"`
	BroadcasterType string `json:"broadcaster_type"`
	Description     string `json:"description"`
	ProfileImageUrl string `json:"profile_image_url"`
	OfflineImageUrl string `json:"offline_image_url"`
	ViewCount       int    `json:"view_count"`
}

type Response

type Response struct {
	Data []ApiStreamer `json:"data"`
}

type Streamer

type Streamer struct {
	Name         string
	Category     string
	Status       string
	CurrentTitle string
}

Streamer represents a twitch streamer with properties that will be displayed to the user.

func FilterForCategory

func FilterForCategory(streamers []Streamer, category string) ([]Streamer, error)

func ReadStreamersFromFile

func ReadStreamersFromFile() ([]Streamer, error)

ReadStreamersFromFile reads the .streamstatus config and loads the streamers.

Jump to

Keyboard shortcuts

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