Documentation ¶
Index ¶
- Constants
- Variables
- type Asset
- type Caption
- type Chapter
- type Client
- func (c *Client) GET(ctx context.Context, url string) (*http.Response, error)
- func (c *Client) GetCourse(ctx context.Context, ID int) (*Course, error)
- func (c *Client) GetUser(ctx context.Context) (*User, error)
- func (c *Client) ListCourses(ctx context.Context, opt *PaginationOptions) (*Courses, error)
- func (c *Client) LoadCurriculum(ctx context.Context, courseID int, opt *PaginationOptions) (*Curriculum, error)
- func (c *Client) Login(ctx context.Context, email, password string) (Credentials, error)
- type Course
- type Courses
- type Credentials
- type Curriculum
- type CurriculumItems
- type DownloadURLs
- type File
- type Lecture
- type Lectures
- type Locale
- type PaginationOptions
- type PriceDetail
- type StreamURLs
- type User
- type Video
Constants ¶
View Source
const ( LoginPath = "auth/udemy-auth/login" UserPath = "users/me" MyCoursesPath = "users/me/subscribed-courses" CoursesPath = "courses" Timeout = time.Second * 600 )
View Source
const BaseURL = "https://www.udemy.com/api-2.0"
View Source
const LoginFormURL = "https://www.udemy.com/join/login-popup/?display_type=popup&response_type=json"
LOGIN
Variables ¶
View Source
var DefaultClient = New()
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { ID int `json:"id"` AssetType string `json:"asset_type"` Title string `json:"title"` ExternalURL string `json:"external_url"` DownloadUrls *DownloadURLs `json:"download_urls"` //SlideUrls []interface{} `json:"slide_urls"` StreamUrls *StreamURLs `json:"stream_urls"` Captions []*Caption `json:"captions"` }
type Client ¶
type Client struct { HTTPClient *http.Client Credentials Credentials }
func (*Client) ListCourses ¶
func (*Client) LoadCurriculum ¶
func (c *Client) LoadCurriculum(ctx context.Context, courseID int, opt *PaginationOptions) (*Curriculum, error)
type Course ¶
type Courses ¶
type Courses struct { Count int `json:"count"` Next string `json:"next"` Previous string `json:"previous"` Results []*Course `json:"results"` }
func ListCourses ¶ added in v0.2.0
func ListCourses(opt *PaginationOptions) (*Courses, error)
type Credentials ¶ added in v0.2.0
func Login ¶ added in v0.2.0
func Login(username, password string) (cred Credentials, err error)
type Curriculum ¶
type Curriculum struct { Count int `json:"count"` Next string `json:"next"` Previous string `json:"previous"` Results CurriculumItems `json:"results"` }
func LoadCurriculum ¶ added in v0.2.0
func LoadCurriculum(courseID int, opt *PaginationOptions) (*Curriculum, error)
type CurriculumItems ¶ added in v0.2.0
type CurriculumItems []interface{}
CurriculumItem contains either *Chapter or *Lecture items
func (*CurriculumItems) UnmarshalJSON ¶ added in v0.2.0
func (c *CurriculumItems) UnmarshalJSON(data []byte) error
type DownloadURLs ¶
type PaginationOptions ¶
type PriceDetail ¶
type StreamURLs ¶
type StreamURLs struct {
Video []*Video `json:"Video"`
}
Click to show internal directories.
Click to hide internal directories.