Documentation ¶
Index ¶
- Constants
- Variables
- func Auth() error
- func GetArticleInfo(articleID int) (response.V1ArticleResponse, error)
- func InitClient(cookies []*http.Cookie)
- func Login(phone, password string) ([]*http.Cookie, error)
- func PostUniversityV1VideoPlayAuth(articleID, classID int) (response.V1VideoPlayAuthResponse, error)
- func PostV3ArticleInfo(articleID int) (response.V3ArticleInfoResponse, error)
- func PostV3ProductInfo(productID int) (response.V3ProductInfoResponse, error)
- func PostV3VideoPlayAuth(articleID, sourceType int, videoID string) (string, error)
- type Article
- type ErrGeekTimeAPIBadCode
- type Product
- type ProductType
Constants ¶
View Source
const ( // V1ColumnArticlesPath get all articles summary info in one column V1ColumnArticlesPath = "/serv/v1/column/articles" // V1ArticlePath used in normal column V1ArticlePath = "/serv/v1/article" // V3ColumnInfoPath used in get normal column/video info V3ColumnInfoPath = "/serv/v3/column/info" // V3ProductInfoPath used in get daily lesson, qconplus product info V3ProductInfoPath = "/serv/v3/product/info" // V3ArticleInfoPath used in normal video, daily lesson, qconplus V3ArticleInfoPath = "serv/v3/article/info" // V3VideoPlayAuthPath used in normal video, daily lesson, qconplus video play auth V3VideoPlayAuthPath = "serv/v3/source_auth/video_play_auth" // UniversityV1VideoPlayAuthPath used in university video play auth UniversityV1VideoPlayAuthPath = "/serv/v1/video/play-auth" // UniversityV1MyClassInfoPath get university class info and all articles info in it UniversityV1MyClassInfoPath = "/serv/v1/myclass/info" )
View Source
const LoginPath = "/account/ticket/login"
LoginPath ...
Variables ¶
View Source
var ( // ErrWrongPassword ... ErrWrongPassword = errors.New("密码错误, 请尝试重新登录") // ErrTooManyLoginAttemptTimes ... ErrTooManyLoginAttemptTimes = errors.New("密码输入错误次数过多,已触发验证码校验,请稍后再试") )
View Source
var ( // SiteCookies ... SiteCookies []*http.Cookie )
Functions ¶
func Auth ¶ added in v0.2.1
func Auth() error
Auth check if current user login is expired or login in another device
func GetArticleInfo ¶ added in v0.5.1
func GetArticleInfo(articleID int) (response.V1ArticleResponse, error)
GetArticleInfo ...
func InitClient ¶ added in v0.4.1
InitClient init golbal clients with cookies
func PostUniversityV1VideoPlayAuth ¶ added in v0.9.1
func PostUniversityV1VideoPlayAuth(articleID, classID int) (response.V1VideoPlayAuthResponse, error)
PostUniversityV1VideoPlayAuth ...
func PostV3ArticleInfo ¶ added in v0.9.1
func PostV3ArticleInfo(articleID int) (response.V3ArticleInfoResponse, error)
PostV3ArticleInfo used to get daily lesson or qconplus article info
func PostV3ProductInfo ¶ added in v0.9.1
func PostV3ProductInfo(productID int) (response.V3ProductInfoResponse, error)
PostV3ProductInfo used to get daily lesson or qconplus product info
Types ¶
type Article ¶ added in v0.4.1
Article ...
func PostV1ColumnArticles ¶ added in v0.9.1
PostV1ColumnArticles call geektime api to get article list
type ErrGeekTimeAPIBadCode ¶ added in v0.3.2
ErrGeekTimeAPIBadCode ...
func (ErrGeekTimeAPIBadCode) Error ¶ added in v0.3.2
func (e ErrGeekTimeAPIBadCode) Error() string
Error implements error interface
type Product ¶ added in v0.2.1
Product ...
func GetMyClassProduct ¶ added in v0.8.1
GetMyClassProduct ...
func PostV3ColumnInfo ¶ added in v0.9.1
PostV3ColumnInfo get normal column info, like v3 product info
type ProductType ¶ added in v0.9.1
type ProductType string
ProductType geektime product type
const ( // ProductTypeColumn 专栏 ProductTypeColumn ProductType = "c1" // ProductTypeNormalVideo 视频课 ProductTypeNormalVideo ProductType = "c3" // ProductTypeDailyLesson 每日一课 ProductTypeDailyLesson ProductType = "d" // ProductTypeQCONPlus 大厂案例 ProductTypeQCONPlus ProductType = "q" // ProductTypeUniversityVideo 训练营视频,自定义类型 ProductTypeUniversityVideo ProductType = "u" )
Click to show internal directories.
Click to hide internal directories.