Documentation
¶
Index ¶
- Variables
- func AutoStart(extraArgs string) error
- func DeleteEPG() error
- func GenEPG() error
- func IsUpdateAvailable(currentVersion, customVersion string) string
- func JioTVServer(jiotvServerConfig JioTVServerConfig) error
- func LoginOTP() error
- func LoginPassword() error
- func Logout() error
- func PrintIfUpdateAvailable(c *cli.Context)
- func RunInBackground(args string, configPath string) error
- func StopBackground(configPath string) error
- func Update(currentVersion, customVersion string) error
- type Asset
- type JioTVServerConfig
- type Release
Constants ¶
This section is empty.
Variables ¶
var PID_FILE_NAME = ".jiotv_go.pid"
var PID_FILE_PATH string
Functions ¶
func AutoStart ¶
AutoStart adds or updates an auto start command for the current executable in the bashrc file. It checks if auto start already exists, gets user consent if needed, and adds the command to run the executable on startup, passing any extra args. It supports Linux, Android and OSX systems.
func DeleteEPG ¶
func DeleteEPG() error
DeleteEPG deletes the existing epg.xml.gz file if it exists. It logs status messages about deleting or not finding the file. Returns any errors encountered except os.ErrNotExist.
func GenEPG ¶
func GenEPG() error
GenEPG generates a new epg.xml.gz file with updated EPG data by first deleting any existing epg.xml.gz file. It initializes the utils.Log global logger, calls epg.GenXMLGz() to generate the XML, and returns any errors.
func IsUpdateAvailable ¶
IsUpdateAvailable checks if a newer version of the application is available by calling getLatestRelease() to fetch the latest release information from GitHub.
func JioTVServer ¶
func JioTVServer(jiotvServerConfig JioTVServerConfig) error
JioTVServer starts the JioTV server. It loads the config, initializes logging, secure URLs, and EPG. It then configures the Fiber app with middleware and routes. It starts listening on the provided host and port. Returns an error if listening fails.
func LoginOTP ¶
func LoginOTP() error
LoginOTP handles the login flow using OTP. It takes the mobile number as input, sends an OTP, verifies the entered OTP by the user and logs in the user. Returns any error encountered.
func LoginPassword ¶
func LoginPassword() error
LoginPassword handles the login flow using password. It takes the mobile number and password as input, verifies the credentials by calling the Login API and logs in the user if successful. Returns any error encountered.
func Logout ¶
func Logout() error
Logout logs the user out by removing the saved login credentials file. It checks if the file exists before removing to avoid errors. Logs messages to provide feedback to the user. Returns any errors encountered.
func PrintIfUpdateAvailable ¶
func PrintIfUpdateAvailable(c *cli.Context)
PrintIfUpdateAvailable checks if a newer version of the application is available
func RunInBackground ¶
RunInBackground starts the JioTV Go server as a background process by executing the current binary with the provided arguments. It stores the process ID in a file in the user's home directory so it can be stopped later. Returns any errors encountered while starting the process.
func StopBackground ¶
StopBackground stops the background JioTV Go server process that was previously started with RunInBackground. It reads the PID from the PID file, sends a kill signal to that process, and deletes the PID file. Returns any errors encountered.
Types ¶
type Asset ¶
type Asset struct { Name string `json:"name"` BrowserDownloadURL string `json:"browser_download_url"` }
Asset defines the structure of an asset from the GitHub API release response. It contains the asset name and browser download URL.