Documentation ¶
Index ¶
- Variables
- func CheckLoggedIn() bool
- func ContainsString(item string, slice []string) bool
- func FileExists(filename string) bool
- func GenerateCurrentTime() string
- func GenerateDate() string
- func GetCredentialsPath() string
- func GetLogger() *log.Logger
- func GetRequestClient() *fasthttp.Client
- func Login(username, password string) (map[string]string, error)
- func LoginSendOTP(number string) (bool, error)
- func LoginVerifyOTP(number, otp string) (map[string]string, error)
- func Logout() error
- func ScheduleFunctionCall(fn func(), executeTime time.Time)
- func WriteJIOTVCredentials(credentials *JIOTV_CREDENTIALS) error
- type JIOTV_CREDENTIALS
- type LoginOTPPayload
- type LoginPasswordPayload
- type LoginPayloadDeviceInfo
- type LoginPayloadDeviceInfoInfo
- type LoginPayloadDeviceInfoInfoPlatform
- type LoginResponse
Constants ¶
This section is empty.
Variables ¶
var ( // Log is a global logger // initialized in main.go // used to log debug messages and errors Log *log.Logger )
Functions ¶
func ContainsString ¶ added in v2.20.0
ContainsString checks if item string is present in slice
func FileExists ¶
FileExists function check if given file exists
func GenerateCurrentTime ¶ added in v2.19.0
func GenerateCurrentTime() string
GenerateCurrentTime generates current time in YYYYMMDDTHHMMSS format
func GenerateDate ¶ added in v2.19.0
func GenerateDate() string
GenerateDate generates date in YYYYMMDD format
func GetCredentialsPath ¶
func GetCredentialsPath() string
GetCredentialsPath returns the file path to credentials file
func GetRequestClient ¶
GetRequestClient create a HTTP client with proxy if given Otherwise create a HTTP client without proxy Returns a fasthttp.Client
func LoginSendOTP ¶
LoginSendOTP sends OTP to the given number for login
func LoginVerifyOTP ¶
LoginVerifyOTP verifies OTP for login
func ScheduleFunctionCall ¶
ScheduleFunctionCall schedules a function call at a given time
func WriteJIOTVCredentials ¶
func WriteJIOTVCredentials(credentials *JIOTV_CREDENTIALS) error
WriteJIOTVCredentials writes credentials data to file
Types ¶
type JIOTV_CREDENTIALS ¶
type JIOTV_CREDENTIALS struct { SSOToken string `json:"ssoToken"` UniqueID string `json:"uniqueId"` CRM string `json:"crm"` AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` LastTokenRefreshTime string `json:"lastTokenRefreshTime"` }
JIOTV_CREDENTIALS represents JioTV Go credentials. Includes some mandatory header values required for making requests to JioTV API
func GetJIOTVCredentials ¶
func GetJIOTVCredentials() (*JIOTV_CREDENTIALS, error)
GetJIOTVCredentials return credentials from environment variables or credentials file Important note: If credentials are provided from environment variables, they will be used instead of credentials file
type LoginOTPPayload ¶
type LoginOTPPayload struct { Number string `json:"number"` OTP string `json:"otp"` DeviceInfo LoginPayloadDeviceInfo `json:"deviceInfo"` }
LoginOTPPayload represents Request payload for OTP based login
type LoginPasswordPayload ¶
type LoginPasswordPayload struct { // Username or phone number of the Jio account Identifier string `json:"identifier"` // Password of the Jio account Password string `json:"password"` // Remember user after login RememberUser string `json:"rememberUser"` UpgradeAuth string `json:"upgradeAuth"` ReturnSessionDetails string `json:"returnSessionDetails"` DeviceInfo LoginPayloadDeviceInfo `json:"deviceInfo"` }
LoginPasswordPayload represents Request payload for password based login
type LoginPayloadDeviceInfo ¶
type LoginPayloadDeviceInfo struct { ConsumptionDeviceName string `json:"consumptionDeviceName"` Info LoginPayloadDeviceInfoInfo `json:"info"` }
LoginPayloadDeviceInfo represents Device info for the login API
type LoginPayloadDeviceInfoInfo ¶
type LoginPayloadDeviceInfoInfo struct { Type string `json:"type"` Platform LoginPayloadDeviceInfoInfoPlatform `json:"platform"` AndroidID string `json:"androidId"` }
LoginPayloadDeviceInfoInfo represents Info for the login API
type LoginPayloadDeviceInfoInfoPlatform ¶
type LoginPayloadDeviceInfoInfoPlatform struct { Name string `json:"name"` Version string `json:"version"` }
LoginPayloadDeviceInfoInfoPlatform represents Platform info for the login API
type LoginResponse ¶
type LoginResponse struct { AuthToken string `json:"authToken"` RefreshToken string `json:"refreshToken"` SSOToken string `json:"ssoToken"` SessionAttributes struct { User struct { SubscriberID string `json:"subscriberId"` Unique string `json:"unique"` } `json:"user"` } `json:"sessionAttributes"` }
LoginResponse represents Response from the JioTV login API