Documentation ¶
Overview ¶
Package upload encapsulates prepping an image for sending to discord, and actually uploading it there.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶ added in v0.11.1
type State ¶ added in v0.12.0
type State string
const ( StatePending State = "Pending" // waiting for decision to upload (could be edited) StateQueued State = "Queued" // ready for upload StateUploading State = "Uploading" // uploading StateComplete State = "Complete" // finished successfully StateFailed State = "Failed" // failed StateSkipped State = "Skipped" // user did not want to upload )
type Upload ¶
type Upload struct { Id int32 `json:"id"` UploadedAt time.Time `json:"uploaded_at"` OriginalFilename string `json:"original_file"` // path on the local disk MarkedUpFilename string `json:"markedup_file"` // a temporary file, if the user did some markup Url string `json:"url"` // url on the discord CDN Width int `json:"width"` Height int `json:"height"` State State `json:"state"` Client HTTPClient `json:"-"` // contains filtered or unexported fields }
func (*Upload) RemoveMarkupTempFile ¶ added in v0.12.0
func (u *Upload) RemoveMarkupTempFile()
type Uploader ¶
func NewUploader ¶
func NewUploader() *Uploader
func (*Uploader) Upload ¶
func (u *Uploader) Upload()
Upload uploads any files that have not yet been uploaded
func (*Uploader) UploadById ¶ added in v0.12.0
Click to show internal directories.
Click to hide internal directories.