Documentation
¶
Overview ¶
Package dribbble is Go library for interacting with Dribbble API v2
Index ¶
- type Attachments
- type Client
- type Config
- type Error
- type JobIn
- type JobOut
- type Jobs
- type LikeOut
- type LikedShotOut
- type Likes
- type PopularShotOut
- type ProjectIn
- type ProjectOut
- type Projects
- type ShotOut
- type Shots
- func (c *Shots) DeleteShot(id int) error
- func (c *Shots) GetPopularShots() (out *[]PopularShotOut, err error)
- func (c *Shots) GetShot(id int) (out *ShotOut, err error)
- func (c *Shots) GetShots() (out *[]ShotOut, err error)
- func (c *Shots) UpdateShot(id int, in *UpdateShotIn) (out *ShotOut, err error)
- type UpdateShotIn
- type User
- type UserOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachments ¶
type Attachments struct {
*Client
}
Attachments client
func (*Attachments) DeleteAttachment ¶
func (c *Attachments) DeleteAttachment(shotID int, attachmentID int) error
DeleteAttachment requires the user to be authenticated with the upload scope The authenticated user must also own the attachment
type Client ¶
type Client struct {
*Config
User *User
Projects *Projects
Shots *Shots
Jobs *Jobs
Likes *Likes
Attachments *Attachments
}
Client struct
type JobIn ¶
type JobIn struct {
OrganizationName string `json:"organization_name"`
Title string `json:"title"`
Location string `json:"location"`
URL string `json:"url"`
Active bool `json:"active"`
Team interface{} `json:"team"`
}
JobIn schema
type JobOut ¶
type JobOut struct {
ID int `json:"id"`
OrganizationName string `json:"organization_name"`
Title string `json:"title"`
Location string `json:"location"`
URL string `json:"url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Active bool `json:"active"`
StartsAt time.Time `json:"starts_at"`
EndsAt time.Time `json:"ends_at"`
Team interface{} `json:"team"`
}
JobOut schema
type Jobs ¶
type Jobs struct {
*Client
}
Jobs client In order to use this part of API, you will need special token
type LikeOut ¶
type LikeOut struct {
ID int `json:"id"`
CreatedAt time.Time `json:"created_at"`
Shot struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Images struct {
Hidpi interface{} `json:"hidpi"`
Normal string `json:"normal"`
Teaser string `json:"teaser"`
} `json:"images"`
PublishedAt time.Time `json:"published_at"`
HTMLURL string `json:"html_url"`
Height int `json:"height"`
Width int `json:"width"`
} `json:"shot"`
User struct {
ID int `json:"id"`
Name string `json:"name"`
Login string `json:"login"`
HTMLURL string `json:"html_url"`
} `json:"user"`
}
LikeOut response structure
type LikedShotOut ¶
LikedShotOut response structure
type Likes ¶
type Likes struct {
*Client
}
Likes client
func (*Likes) GetLikes ¶
GetLikes returns list of authenticated user’s liked shots Note: This is available only to select applications with our approval
func (*Likes) GetShotLike ¶
func (c *Likes) GetShotLike(id int) (out *LikedShotOut, err error)
GetShotLike checks if you like a shot Note: This is available only to select applications with our approval
func (*Likes) LikeShot ¶
func (c *Likes) LikeShot(id int) (out *LikedShotOut, err error)
LikeShot with given id Note: This is available only to select applications with our approval
func (*Likes) UnlikeShot ¶
UnlikeShot with given id Note: This is available only to select applications with our approval Unliking a shot requires the user to be authenticated with the write scope
type PopularShotOut ¶
type PopularShotOut struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Images struct {
Hidpi interface{} `json:"hidpi"`
Normal string `json:"normal"`
Teaser string `json:"teaser"`
} `json:"images"`
PublishedAt time.Time `json:"published_at"`
HTMLURL string `json:"html_url"`
Height int `json:"height"`
Width int `json:"width"`
}
PopularShotOut schema
type ProjectOut ¶
type ProjectOut struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ShotsCount int `json:"shots_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ProjectOut response structure
type Projects ¶
type Projects struct {
*Client
}
Projects client
func (*Projects) CreateProject ¶
func (c *Projects) CreateProject(in *ProjectIn) (out *ProjectOut, err error)
CreateProject with given payload
func (*Projects) DeleteProject ¶
DeleteProject with given id
func (*Projects) GetProjects ¶
func (c *Projects) GetProjects() (out *[]ProjectOut, err error)
GetProjects of authenticated user
func (*Projects) UpdateProject ¶
func (c *Projects) UpdateProject(id int, in *ProjectIn) (out *ProjectOut, err error)
UpdateProject with given id
type ShotOut ¶
type ShotOut struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Width int `json:"width"`
Height int `json:"height"`
Images struct {
Hidpi interface{} `json:"hidpi"`
Normal string `json:"normal"`
Teaser string `json:"teaser"`
} `json:"images"`
PublishedAt time.Time `json:"published_at"`
UpdatedAt time.Time `json:"updated_at"`
HTMLURL string `json:"html_url"`
Animated bool `json:"animated"`
Tags []string `json:"tags"`
Attachments []struct {
ID int `json:"id"`
URL string `json:"url"`
ThumbnailURL string `json:"thumbnail_url"`
Size int `json:"size"`
ContentType string `json:"content_type"`
CreatedAt time.Time `json:"created_at"`
} `json:"attachments"`
Projects []struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ShotsCount int `json:"shots_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"projects"`
Team struct {
ID int `json:"id"`
Name string `json:"name"`
Login string `json:"login"`
HTMLURL string `json:"html_url"`
AvatarURL string `json:"avatar_url"`
Bio string `json:"bio"`
Location string `json:"location"`
Links struct {
Web string `json:"web"`
Twitter string `json:"twitter"`
} `json:"links"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"team"`
Video struct {
ID int `json:"id"`
Duration int `json:"duration"`
VideoFileName string `json:"video_file_name"`
VideoFileSize int `json:"video_file_size"`
Width int `json:"width"`
Height int `json:"height"`
Silent bool `json:"silent"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
URL string `json:"url"`
SmallPreviewURL string `json:"small_preview_url"`
LargePreviewURL string `json:"large_preview_url"`
XlargePreviewURL string `json:"xlarge_preview_url"`
} `json:"video"`
LowProfile bool `json:"low_profile"`
}
ShotOut single schema
type Shots ¶
type Shots struct {
*Client
}
Shots instance
func (*Shots) DeleteShot ¶
DeleteShot with given id Deleting a shot requires the user to be authenticated with the upload scope The authenticated user must also own the shot
func (*Shots) GetPopularShots ¶
func (c *Shots) GetPopularShots() (out *[]PopularShotOut, err error)
GetPopularShots overall Note: This is available only to select applications with our approval
func (*Shots) GetShot ¶
GetShot with given id This method returns only shots owned by the currently authenticated user
func (*Shots) UpdateShot ¶
func (c *Shots) UpdateShot(id int, in *UpdateShotIn) (out *ShotOut, err error)
UpdateShot with given id and payload Updating a shot requires the user to be authenticated with the upload scope The authenticated user must also own the shot
type UpdateShotIn ¶
type UpdateShotIn struct {
Title string `json:"title"`
Description string `json:"description"`
Tags []string `json:"tags"`
}
UpdateShotIn for updating shot
type UserOut ¶
type UserOut struct {
ID int `json:"id"`
Name string `json:"name"`
Login string `json:"login"`
HTMLURL string `json:"html_url"`
AvatarURL string `json:"avatar_url"`
Bio string `json:"bio"`
Location string `json:"location"`
Links struct {
Web string `json:"web"`
Twitter string `json:"twitter"`
} `json:"links"`
CanUploadShot bool `json:"can_upload_shot"`
Pro bool `json:"pro"`
FollowersCount int `json:"followers_count"`
CreatedAt time.Time `json:"created_at"`
Type string `json:"type"`
Teams []struct {
ID int `json:"id"`
Name string `json:"name"`
Login string `json:"login"`
HTMLURL string `json:"html_url"`
AvatarURL string `json:"avatar_url"`
Bio string `json:"bio"`
Location string `json:"location"`
Links struct {
Web string `json:"web"`
Twitter string `json:"twitter"`
} `json:"links"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"teams"`
}
UserOut response structure