Documentation ¶
Index ¶
- func ParseErrors(r *http.Response) error
- func PostFiles(url string, data map[string]string, files ...FilePart) *http.Response
- func ReadAndPostMedia(mediaPath, uploadURL string, data map[string]string) *http.Response
- type FilePart
- type Submission
- type SubmitMediaResponse
- type UploadMediaResponse
- type Uploader
- func (u *Uploader) GetAccessToken() (string, error)
- func (u *Uploader) Post(url string, data io.Reader, auth ...bool) *http.Response
- func (u *Uploader) SubmitImage(params Submission, imagePath string) error
- func (u *Uploader) SubmitMedia(post interface{}) error
- func (u *Uploader) SubmitVideo(params Submission, videoPath, previewPath string) error
- func (u *Uploader) UploadMedia(mediaPath string) (string, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseErrors ¶
Types ¶
type Submission ¶
type Submission struct { Subreddit string `url:"sr,omitempty"` Title string `url:"title,omitempty"` FlairID string `url:"flair_id,omitempty"` FlairText string `url:"flair_text,omitempty"` SendReplies *bool `url:"sendreplies,omitempty"` Resubmit bool `url:"resubmit,omitempty"` NSFW bool `url:"nsfw,omitempty"` Spoiler bool `url:"spoiler,omitempty"` }
type SubmitMediaResponse ¶
type SubmitMediaResponse struct { Message string `json:"message"` Error int `json:"error"` JSON struct { Errors [][]string `json:"errors"` Data struct { URL string `json:"url"` UserSubmittedPage string `json:"user_submitted_page"` WebsocketURL string `json:"websocket_url"` } `json:"data"` } `json:"json"` }
type UploadMediaResponse ¶
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func (*Uploader) GetAccessToken ¶
func (*Uploader) SubmitImage ¶
func (u *Uploader) SubmitImage(params Submission, imagePath string) error
func (*Uploader) SubmitMedia ¶
func (*Uploader) SubmitVideo ¶
func (u *Uploader) SubmitVideo(params Submission, videoPath, previewPath string) error
Click to show internal directories.
Click to hide internal directories.