-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.go
58 lines (41 loc) · 1.21 KB
/
upload.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package tdproto
// Uploaded media
type Upload struct {
// Upload id
Uid string `json:"uid"`
// Uploaded at
Created ISODateTimeString `json:"created"`
// Upload size in bytes
Size int `json:"size"`
// Mediafile duration (for audio/video only)
Duration uint `json:"duration,omitempty"`
// Filename
Name string `json:"name"`
// Absolute url
Url string `json:"url"`
// Preview details
Preview *UploadPreview `json:"preview,omitempty"`
// Content type
ContentType string `json:"content_type"`
// Is animated (images only)
Animated bool `json:"animated,omitempty"`
// Compact representation of a placeholder for an image (images only)
Blurhash string `json:"blurhash,omitempty"`
// File still processing (video only)
Processing bool `json:"processing,omitempty"`
// PDF version of file. Experimental
PdfVersion *PdfVersion `json:"pdf_version,omitempty"`
// ?type=file,image,audio,video
MediaType UploadMediaType `json:"type"`
}
// Upload preview
type UploadPreview struct {
// Absolute url to image
Url string `json:"url"`
// Absolute url to high resolution image (retina)
Url2x string `json:"url_2x"`
// Width in pixels
Width int `json:"width"`
// Height in pixels
Height int `json:"height"`
}