tvtime

package module
v0.0.0-...-fa1ebae Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 13 Imported by: 0

README

Build Status Release Software License Coverage Status Go Report Card

Go TvTime

Go TvTime is a CLI application to manage TV Time account and episodes.

Install

Install latest version using Golang (recommended)

$ go get github.com/Sh4d1/go-tvtime/cmd/tvtime

Or build from source

$ go get -u github.com/Sh4d1/go-tvtime
$ cd $GOPATH/src/github.com/Sh4d1/go-tvtime
$ make build

Usage

$ tvtime -h
NAME:
   tvtime - tvtime

USAGE:
    tvtime [global options] command [command options] [arguments...]

VERSION:
    master

AUTHOR:
    Patrik Cyvoct (patrik@ptrk.io)

COMMANDS:
    login      Login to TV Time
    user       Display current user
    upcoming   Display upcoming episodes
    watchlist  Display watchlist
    help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
    --help, -h     show help
    --version, -v  print the version

Contributions

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. We appreciate your contribution. Please refer to our contributing guidelines.

License

MIT

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayUpcoming

func DisplayUpcoming() error

DisplayUpcoming displays the upcoming episodes

func DisplayUser

func DisplayUser() error

DisplayUser displays the current user

func DisplayWatchlist

func DisplayWatchlist() error

DisplayWatchlist displays the upcoming episodes

func GetAccessToken

func GetAccessToken() (string, error)

GetAccessToken returns the access token

func HaveSettings

func HaveSettings() bool

HaveSettings returns true if we have some settings

func Login

func Login() error

Login logs in a user

func WriteSettings

func WriteSettings(settings Settings) error

WriteSettings writes the settings

Types

type AccessTokenResponse

type AccessTokenResponse struct {
	Result      string `json:"result"`
	Message     string `json:"message"`
	AccessToken string `json:"access_token"`
}

AccessTokenResponse is the struct to store the response of the access token call

type DeviceCodeResponse

type DeviceCodeResponse struct {
	Result          string `json:"result"`
	Message         string `json:"message"`
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURL string `json:"verification_url"`
	ExpiresIn       int64  `json:"expires_in"`
	Interval        int64  `json:"interval"`
}

DeviceCodeResponse is the struct to store the response of the device code call

type Episode

type Episode struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	Number       int    `json:"number"`
	SeasonNumber int    `json:"season_number"`
	AirDate      string `json:"air_date"`
	AirTime      string `json:"air_time"`
	Network      string `json:"network"`
	IsNew        bool   `json:"is_new"`
	Seen         bool   `json:"seen"`
	Show         Show   `json:"show"`
}

Episode is the struct to store an episode

func GetUpcoming

func GetUpcoming() ([]Episode, error)

GetUpcoming returns the upcoming episodes

func GetWatchlist

func GetWatchlist() ([]Episode, error)

GetWatchlist return the watchlist

type GetUpcomingResponse

type GetUpcomingResponse struct {
	Result   string    `json:"result"`
	Episodes []Episode `json:"episodes"`
	Message  string    `json:"message"`
	Code     int       `json:"code"`
}

GetUpcomingResponse stores the get response of the upcoming

type GetUserResponse

type GetUserResponse struct {
	Result  string `json:"result"`
	User    User   `json:"user"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

GetUserResponse stores the get response of the user

type GetWatchlistResponse

type GetWatchlistResponse struct {
	Result   string    `json:"result"`
	Episodes []Episode `json:"episodes"`
	Message  string    `json:"message"`
	Code     int       `json:"code"`
}

GetWatchlistResponse stores the get response of the watchlist

type Settings

type Settings struct {
	AccessToken string
}

Settings stores the access token

func GetSettings

func GetSettings() (*Settings, error)

GetSettings returns the settings

type Show

type Show struct {
	ID            int    `json:"id"`
	Name          string `json:"name"`
	SeenEpisodes  int    `json:"seen_episodes"`
	AiredEpisodes int    `json:"aired_episodes"`
}

Show is the struct to store a show

type User

type User struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

User is the struct to store a user

func GetUser

func GetUser() (User, error)

GetUser returns the user

Directories

Path Synopsis
cmd
tvtime command

Jump to

Keyboard shortcuts

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