api update

This commit is contained in:
2018-10-04 23:36:34 +02:00
parent 356bf63ed3
commit 78e5acdfcc
17 changed files with 81 additions and 77 deletions

View File

@@ -15,11 +15,11 @@ func (p *PixelAPI) GetFile(id string) (io.ReadCloser, error) {
type FileInfo struct {
Success bool `json:"success"`
ID string `json:"id"`
FileName string `json:"file_name"`
Name string `json:"name"`
Size uint64 `json:"size"`
Views int `json:"views"`
DateUpload time.Time `json:"date_upload"`
DateLastview time.Time `json:"date_last_view"`
FileSize uint64 `json:"file_size"`
Views uint `json:"views"`
DateLastView time.Time `json:"date_last_view"`
MimeType string `json:"mime_type"`
MimeImage string `json:"mime_image"`
ThumbnailHREF string `json:"thumbnail_href"`

View File

@@ -9,23 +9,22 @@ const (
// List information object from the pixeldrain API
type List struct {
Success bool `json:"success"`
ID string `json:"id"`
Title string `json:"title"`
DateCreated time.Time `json:"date_created"`
FileCount int `json:"file_count"`
Files []ListFile
Success bool `json:"success"`
ID string `json:"id"`
Title string `json:"title"`
DateCreated time.Time `json:"date_created"`
FileCount int `json:"file_count"`
Files []ListFile `json:"files,omitempty"`
}
// ListFile information object from the pixeldrain API
type ListFile struct {
ID string `json:"id"`
DetailHREF string `json:"detail_href"`
FileName string `json:"file_name"`
Description string `json:"description"`
DateCreated time.Time `json:"date_created"`
DateLastView time.Time `json:"date_last_view"`
ListDescription string `json:"list_description"`
ID string `json:"id"`
DetailHREF string `json:"detail_href"`
Name string `json:"name"`
Description string `json:"description"`
DateCreated time.Time `json:"date_created"`
DateLastView time.Time `json:"date_last_view"`
}
// GetList get a List from the pixeldrain API. Errors will be available through